xref: /dragonfly/contrib/openbsd_libm/man/sqrt.3 (revision 31524921)
1.\"	$OpenBSD: sqrt.3,v 1.16 2013/07/17 05:42:11 schwarze Exp $
2.\" Copyright (c) 1985, 1991 Regents of the University of California.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 3. Neither the name of the University nor the names of its contributors
14.\"    may be used to endorse or promote products derived from this software
15.\"    without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\"     from: @(#)sqrt.3	6.4 (Berkeley) 5/6/91
30.\"
31.Dd $Mdocdate: July 17 2013 $
32.Dt SQRT 3
33.Os
34.Sh NAME
35.Nm cbrt ,
36.Nm cbrtf ,
37.Nm cbrtl ,
38.Nm sqrt ,
39.Nm sqrtf ,
40.Nm sqrtl
41.Nd cube root and square root functions
42.Sh SYNOPSIS
43.In math.h
44.Ft double
45.Fn cbrt "double x"
46.Ft float
47.Fn cbrtf "float x"
48.Ft long double
49.Fn cbrtl "long double x"
50.Ft double
51.Fn sqrt "double x"
52.Ft float
53.Fn sqrtf "float x"
54.Ft long double
55.Fn sqrtl "long double x"
56.Sh DESCRIPTION
57The
58.Fn cbrt
59function computes the cube root of
60.Ar x .
61The
62.Fn cbrtf
63function is a single precision version of
64.Fn cbrt .
65The
66.Fn cbrtl
67function is an extended precision version of
68.Fn cbrt .
69.Pp
70The
71.Fn sqrt
72function computes
73the non-negative square root of x.
74The
75.Fn sqrtf
76function is a single precision version of
77.Fn sqrt .
78The
79.Fn sqrtl
80function is an extended precision version of
81.Fn sqrt .
82.Sh RETURN VALUES
83If x is negative,
84.Fn sqrt "x" ,
85.Fn sqrtf "x"
86and
87.Fn sqrtl "x"
88set the global variable
89.Va errno
90to EDOM.
91.Sh HISTORY
92A
93.Fn sqrt
94function first appeared in
95.At v3 .
96.Pp
97The
98.Fn cbrt
99function appeared in
100.Bx 4.3 .
101