xref: /csrg-svn/lib/libm/common_source/sqrt.3 (revision 61309)
1*61309Sbostic.\" Copyright (c) 1985, 1991, 1993
2*61309Sbostic.\"	The Regents of the University of California.  All rights reserved.
324695Smckusick.\"
449229Scael.\" %sccs.include.redist.roff%
524695Smckusick.\"
6*61309Sbostic.\"     @(#)sqrt.3	8.1 (Berkeley) 06/04/93
748352Scael.\"
848352Scael.Dd
948352Scael.Dt SQRT 3
1048352Scael.Os
1148352Scael.Sh NAME
1248352Scael.Nm cbrt ,
1348352Scael.Nm sqrt
1448352Scael.Nd cube root and square root functions
1548352Scael.Sh SYNOPSIS
1648352Scael.Fd #include <math.h>
1748352Scael.Ft double
1848352Scael.Fn cbrt "double x"
1948352Scael.Ft double
2048352Scael.Fn sqrt "double x"
2148352Scael.Sh DESCRIPTION
2248352ScaelThe
2348352Scael.Fn cbrt
2448352Scaelfunction computes
2548352Scaelthe cube root of
2648352Scael.Ar x .
2748352Scael.Pp
2848352ScaelThe
2948352Scael.Fn sqrt
3048352Scaelcomputes the
3148352Scaelnon-negative square root of x.
3248352Scael.Sh RETURN VALUES
3348352ScaelThe
3448352Scael.Fn cbrt
3548352Scaelfunction returns the requested cube root.
3648352ScaelThe
3748352Scael.Fn sqrt
3848352Scaelfunction returns the requested square root
3948352Scaelunless an error occurs.
4048352ScaelOn the
4148352Scael.Tn VAX
4248352Scaelor
4348352Scael.Tn Tahoe
4448352Scaelprocessor an attempt to take the
4548352Scael.Fn sqrt
4648352Scaelof negative
4748352Scael.Fa x
4848352Scaelcauses an error; in this event,
4948352Scaelthe global variable
5048352Scael.Va errno
5148352Scaelis set to
5248352Scael.Dv EDOM
5348352Scaeland a reserved operand fault is generated.
5448352Scael.Sh ERROR (due to Roundoff etc.)
5548352ScaelThe
5648352Scael.Fn cbrt
5748352Scaelfunction
5848352Scaelis accurate to within 0.7
5948352Scael.Em ulps .
6048352Scael.Pp
6148352ScaelThe
6248352Scael.Fn sqrt
6348352Scaelfunction on a
6448352Scael.Tn VAX
6548352Scaelis accurate to within 0.501
6648352Scael.Em ulps .
6748352ScaelSqrt on a machine that conforms to
6848352Scael.Tn IEEE
6948352Scael754 is correctly rounded
7024378Smiriamin accordance with the rounding mode in force; the error is less than
7148352Scaelhalf an
7248352Scael.Em ulp
7348352Scaelin the default mode (round\-to\-nearest).
7448352ScaelAn
7548352Scael.Em ulp
7648352Scaelis one
7748352Scael.Em U Ns nit
7848352Scaelin the
7948352Scael.Em L Ns ast
8048352Scael.Em P Ns lace
8148352Scaelcarried.
8248352Scael.Sh SEE ALSO
8348352Scael.Xr math 3 ,
8448352Scael.Xr infnan 3
8548352Scael.Sh STANDARDS
8648352ScaelThe
8748352Scael.Nm sqrt
8848352Scaelfunction conforms to
8948352Scael.St -ansiC .
9048352Scael.Sh HISTORY
9148352ScaelThe
9248352Scael.Nm cbrt
9348352Scaelfunction appeared in
9448352Scael.Bx 4.3 .
95