]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - lib/msun/man/sqrt.3
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / lib / msun / man / sqrt.3
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 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     from: @(#)sqrt.3        6.4 (Berkeley) 5/6/91
29 .\" $FreeBSD$
30 .\"
31 .Dd March 1, 2008
32 .Dt SQRT 3
33 .Os
34 .Sh NAME
35 .Nm cbrt ,
36 .Nm cbrtf ,
37 .Nm sqrt ,
38 .Nm sqrtf ,
39 .Nm sqrtl
40 .Nd cube root and square root functions
41 .Sh LIBRARY
42 .Lb libm
43 .Sh SYNOPSIS
44 .In math.h
45 .Ft double
46 .Fn cbrt "double x"
47 .Ft float
48 .Fn cbrtf "float x"
49 .Ft double
50 .Fn sqrt "double x"
51 .Ft float
52 .Fn sqrtf "float x"
53 .Ft long double
54 .Fn sqrtl "long double x"
55 .Sh DESCRIPTION
56 The
57 .Fn cbrt
58 and the
59 .Fn cbrtf
60 functions compute
61 the cube root of
62 .Ar x .
63 .Pp
64 The
65 .Fn sqrt ,
66 .Fn sqrtf ,
67 and
68 .Fn sqrtl
69 functions compute the
70 non-negative square root of x.
71 .Sh RETURN VALUES
72 The
73 .Fn cbrt
74 and the
75 .Fn cbrtf
76 functions return the requested cube root.
77 The
78 .Fn sqrt ,
79 .Fn sqrtf ,
80 and
81 .Fn sqrtl
82 functions return the requested square root
83 unless an error occurs.
84 An attempt to take the
85 .Fn sqrt
86 of negative
87 .Fa x
88 raises an invalid exception and causes an \*(Na to be returned
89 (except that the square root of -0 is valid and equal to -0.)
90 .Sh SEE ALSO
91 .Xr fenv 3 ,
92 .Xr math 3
93 .Sh STANDARDS
94 The
95 .Fn cbrt ,
96 .Fn cbrtf ,
97 .Fn sqrt ,
98 .Fn sqrtf ,
99 and
100 .Fn sqrtl
101 functions conform to
102 .St -isoC-99 .
103 .Sh HISTORY
104 The
105 .Fn cbrt
106 function appeared in
107 .Bx 4.3 .
108 The
109 .Fn sqrtl
110 function appeared in
111 .Fx 8.0 .