sqrt(3M)
cbrt, sqrt, cbrtf, sqrtf, cbrtl, sqrtl, csqrt, csqrtf, csqrtl - cube root, square root
Showing IRIX 6.5.30 (default release). Last changed in IRIX 6.5.19.
NAME cbrt, sqrt, cbrtf, sqrtf, cbrtl, sqrtl, csqrt, csqrtf, csqrtl - cube root, square root SYNOPSIS #include <math.h> double cbrt(double x); float cbrtf(float x); long double cbrtl(long double x); double sqrt(double x); float sqrtf(float x); long double sqrtl(long double x); #include <complex.h> double complex csqrt(double complex z); float complex csqrtf(float complex z); long double complex csqrtl(long double complex z); DESCRIPTION The functions in the complex.h library are not available for programs compiled with the O32 ABI. The single-precision and long double-precision routines listed above are only available in the standard math library, -lm, and in -lmx. Alternate entries exist for several routines. The following lists these routines and the ANSI standard name and the alternate entry name: ANSI standard name Alternate name sqrtf fsqrt cbrtl qcbrt sqrtl qsqrt The sqrt functions return the nonnegative square root of their single argument x. The cbrt functions return the cube root of their single argument x. The function cbrt both accepts and returns values of type double. The function cbrtl both accepts and returns values of type long double. RETURN VALUES Functions in the standard math library libm.a, are referred to as -lm versions. Those in math library libmx.a are referred to as -lmx versions. Those in the the BSD math library libm43.a are referred to as -lm43 versions. The -lm and -lmx versions always return the default Quiet NaN and set errno to EDOM when a NaN is used as an argument. A NaN argument usually causes the -lm43 versions to return the same argument. The -lm43 versions never set errno. If x is negative, the sqrt functions return a quiet NaN. The -lm and -lm43 versions also set the flag in the floating-point coprocessor to indicate an invalid operation. The functions in the standard math library -lm and in library -lmx also set errno to EDOM. See matherr(3M) for a description of error handling for -lmx functions. NOTES Long double operations on this system are only supported in round-to- nearest rounding mode (the default). The system must be in round-to- nearest rounding mode when calling any of the long double functions, or incorrect answers will result. Users concerned with portability to other computer systems should note that the long double and float versions of these functions were optional according to the ANSI C Programming Language Specification ISO/IEC 9899 : 1990 (E) and are no longer optional according to ISO/IEC 9899: 1999 (E). Long double functions have been renamed to be compliant with the ANSI-C standard, however to be backward compatible, they may still be called with the double precision function name prefixed with a q. Code which calls sqrt() or sqrtf() will be compiled into the machine instruction sqrt.d or sqrt.s if the code uses #includes <math.h>. Errors cbrt is accurate to within 0.7 ULPs (a ULP is one Unit in Last Place). libm.a sqrt conforms to IEEE 754 and is correctly rounded in accordance with the rounding mode in force; the error is less than half a ULP in the default mode (round to nearest). The libfastm.a sqrt and fsqrt error is a maximum of one ULP. (See however, the comments regarding -lfastm above.) SEE ALSO math(3M)