BSD 4_4 development
[unix-history] / usr / share / man / cat3 / sqrt.0
SQRT(3) BSD Programmer's Manual SQRT(3)
N\bNA\bAM\bME\bE
c\bcb\bbr\brt\bt, s\bsq\bqr\brt\bt - cube root and square root functions
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<m\bma\bat\bth\bh.\b.h\bh>\b>
_\bd_\bo_\bu_\bb_\bl_\be
c\bcb\bbr\brt\bt(_\bd_\bo_\bu_\bb_\bl_\be _\bx);
_\bd_\bo_\bu_\bb_\bl_\be
s\bsq\bqr\brt\bt(_\bd_\bo_\bu_\bb_\bl_\be _\bx);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The c\bcb\bbr\brt\bt() function computes the cube root of _\bx.
The s\bsq\bqr\brt\bt() computes the non-negative square root of x.
R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bES\bS
The c\bcb\bbr\brt\bt() function returns the requested cube root. The s\bsq\bqr\brt\bt() function
returns the requested square root unless an error occurs. On the VAX or
Tahoe processor an attempt to take the s\bsq\bqr\brt\bt() of negative _\bx causes an er-
ror; in this event, the global variable _\be_\br_\br_\bn_\bo is set to EDOM and a re-
served operand fault is generated.
E\bER\bRR\bRO\bOR\bR (\b(d\bdu\bue\be t\bto\bo R\bRo\bou\bun\bnd\bdo\bof\bff\bf e\bet\btc\bc.\b.)\b)
The c\bcb\bbr\brt\bt() function is accurate to within 0.7 _\bu_\bl_\bp_\bs.
The s\bsq\bqr\brt\bt() function on a VAX is accurate to within 0.501 _\bu_\bl_\bp_\bs. Sqrt on a
machine that conforms to IEEE 754 is correctly rounded in accordance with
the rounding mode in force; the error is less than half an _\bu_\bl_\bp in the de-
fault mode (round-to-nearest). An _\bu_\bl_\bp is one _\bUnit in the _\bLast _\bPlace car-
ried.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
math(3), infnan(3)
S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
The s\bsq\bqr\brt\bt function conforms to ANSI C X3.159-1989 (``ANSI C '').
H\bHI\bIS\bST\bTO\bOR\bRY\bY
The c\bcb\bbr\brt\bt function appeared in 4.3BSD.
4.4BSD June 4, 1993 1