this repo has no description
1.\" Copyright (c) 1985, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91
33.\" $Id: pow.3,v 1.4 2004/12/20 21:35:46 scp Exp $
34.\"
35.Dd December 11, 2006
36.Dt POW 3
37.Os BSD 4
38.Sh NAME
39.Nm pow
40.Nd power function
41.Sh SYNOPSIS
42.Fd #include <math.h>
43.Ft double
44.Fn pow "double x" "double y"
45.Ft long double
46.Fn powl "long double x" "long double y"
47.Ft float
48.Fn powf "float x" "float y"
49.Sh DESCRIPTION
50The
51.Fn pow
52functions compute
53.Fa x
54raised to the power
55.Fa y .
56.Sh SPECIAL VALUES
57.Fn pow "�0" "y"
58returns �infinity and raises the "divide-by-zero" floating-point exception for y an odd integer < 0.
59.Pp
60.Fn pow "�0" "y"
61returns +infinity and raises the "divide-by-zero" floating-point exception for y < 0 and not an odd integer.
62.Pp
63.Fn pow "�0" "y"
64returns �0 for y an odd integer > 0.
65.Pp
66.Fn pow "�0" "y"
67returns +0 for y > 0 and not an odd integer.
68.Pp
69.Fn pow "-1" "�infinity"
70returns 1.
71.Pp
72.Fn pow "1" "y"
73returns 1 for any y, even a NaN.
74.Pp
75.Fn pow "x" "�0"
76returns 1 for any x, even a NaN.
77.Pp
78.Fn pow "x" "y"
79returns a NaN and raises the "invalid" floating-point exception for finite x < 0 and finite non-integer y.
80.Pp
81.Fn pow "x" "-infinity"
82returns +infinity for |x| < 1.
83.Pp
84.Fn pow "x" "-infinity"
85returns +0 for |x| > 1.
86.Pp
87.Fn pow "x" "+infinity"
88returns +0 for |x| < 1.
89.Pp
90.Fn pow "x" "+infinity"
91returns +infinity for |x| > 1.
92.Pp
93.Fn pow "-infinity" "y"
94returns -0 for y an odd integer < 0.
95.Pp
96.Fn pow "-infinity" "y"
97returns +0 for y < 0 and not an odd integer.
98.Pp
99.Fn pow "-infinity" "y"
100returns -infinity for y an odd integer > 0.
101.Pp
102.Fn pow "-infinity" "y"
103returns +infinity for y > 0 and not an odd integer.
104.Pp
105.Fn pow "+infinity" "y"
106returns +0 for y < 0.
107.Pp
108.Fn pow "+infinity" "y"
109returns +infinity for y > 0.
110.Pp
111A domain error occurs if x is finite and negative and y is finite and not an integer.
112.Pp
113A domain error can occur if x is 0 and y less than or equal to 0.
114.Pp
115Range errors may occur.
116.Sh SEE ALSO
117.Xr math 3
118.Sh STANDARDS
119The
120.Fn pow
121function conforms to ISO/IEC 9899:1999(E).