Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.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 .\" 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: @(#)sqrt.3        6.4 (Berkeley) 5/6/91
33 .\" $FreeBSD: src/lib/msun/man/sqrt.3,v 1.6.2.3 2001/12/17 10:08:36 ru Exp $
34 .\" $DragonFly: src/lib/msun/man/Attic/sqrt.3,v 1.2 2003/06/17 04:26:52 dillon Exp $
35 .\"
36 .Dd May 6, 1991
37 .Dt SQRT 3
38 .Os
39 .Sh NAME
40 .Nm cbrt ,
41 .Nm cbrtf ,
42 .Nm sqrt ,
43 .Nm sqrtf
44 .Nd cube root and square root functions
45 .Sh LIBRARY
46 .Lb libm
47 .Sh SYNOPSIS
48 .In math.h
49 .Ft double
50 .Fn cbrt "double x"
51 .Ft float
52 .Fn cbrtf "float x"
53 .Ft double
54 .Fn sqrt "double x"
55 .Ft float
56 .Fn sqrtf "float x"
57 .Sh DESCRIPTION
58 The
59 .Fn cbrt
60 and the
61 .Fn cbrtf
62 functions compute
63 the cube root of
64 .Ar x .
65 .Pp
66 The
67 .Fn sqrt
68 and the
69 .Fn sqrtf
70 functions compute the
71 non-negative square root of x.
72 .Sh RETURN VALUES
73 The
74 .Fn cbrt
75 and the
76 .Fn cbrtf
77 functions return the requested cube root.
78 The
79 .Fn sqrt
80 and the
81 .Fn sqrtf
82 functions return the requested square root
83 unless an error occurs.
84 On the
85 .Tn VAX
86 or
87 .Tn Tahoe
88 processor an attempt to take the
89 .Fn sqrt
90 of negative
91 .Fa x
92 causes an error; in this event,
93 the global variable
94 .Va errno
95 is set to
96 .Er EDOM
97 and a reserved operand fault is generated.
98 .Sh ERROR (due to Roundoff etc.)
99 The
100 .Fn cbrt
101 function
102 is accurate to within 0.7
103 .Em ulps .
104 .Pp
105 The
106 .Fn sqrt
107 function on a
108 .Tn VAX
109 is accurate to within 0.501
110 .Em ulps .
111 Sqrt on a machine that conforms to
112 .Tn IEEE
113 754 is correctly rounded
114 in accordance with the rounding mode in force; the error is less than
115 half an
116 .Em ulp
117 in the default mode (round\-to\-nearest).
118 An
119 .Em ulp
120 is one
121 .Em U Ns nit
122 in the
123 .Em L Ns ast
124 .Em P Ns lace
125 carried.
126 .Sh SEE ALSO
127 .Xr math 3
128 .Sh STANDARDS
129 The
130 .Fn sqrt
131 function conforms to
132 .St -isoC .
133 .Sh HISTORY
134 The
135 .Fn cbrt
136 function appeared in
137 .Bx 4.3 .