Manual Pages for UNIX Darwin command on man math
MyWebUniversity

Manual Pages for UNIX Darwin command on man math

MATH(3) BSD Library Functions Manual MATH(3)

NAME

mmaatthh - mathematical library functions

SYNOPSIS

##iinncclluuddee <>

DESCRIPTION

The header file math.h provides function prototypes and macros for work-

ing with C99 floating point values.

Each math.h function is provided in three variants: single, double and

extended precision. The single and double precision variants operate on

IEEE-754 single and double precision values, which correspond to the C

types float and double, respectively.

On Intel Macs, the C type long double corresponds to 80-bit IEEE-754 dou-

ble extended precision. On PowerPC Macs, the C type long double corre-

sponds by default to ordinary double precision, but a 128-bit non-

IEEE-754 long double type is also available via the compiler flag

-mlong-double-128 and linker flag -lmx.

Details of the floating point formats can be found via "man float". Users who need to repeatedly perform the same calculation on a large set

of data will probably find that the vector math library (composed of

vMathLib and vForce) yields better performance for their needs than sequential calls to the libm.

Users who need to perform mathematical operations on complex floating-

point numbers should consult the man pages for the complex portion of the

math library, via "man complex".

LLIISSTT OOFF FFUUNNCCTTIIOONNSS

Each of the functions that use floating-point values are provided in sin-

gle, double, and extended precision; the double precision prototypes are listed here. The man pages for the individual functions provide more details on their use, special cases, and prototypes for their single and extended precision versions. int ffppccllaassssiiffyy(double) int iissffiinniittee(double) int iissiinnff(double) int iissnnaann(double) int iissnnoorrmmaall(double) int ssiiggnnbbiitt(double)

These function-like macros are used to classify a single floating-point

argument. double ccooppyyssiiggnn(double, double) double nneexxttaafftteerr(double, double) ccooppyyssiiggnn(x, y) returns the value equal in magnitude to x with the sign of

y. nneexxttaafftteerr(x, y) returns the next floating-point number after x in the

direction of y. Both are correctly-rounded.

double nnaann(const char *tag) The nnaann() function returns a quiet NaN, without raising the invalid flag. double cceeiill(double) double fflloooorr(double) double nneeaarrbbyyiinntt(double) double rriinntt(double) double rroouunndd(double) long int llrriinntt(double) long int llrroouunndd(double) long long int llllrriinntt(double) long long int llllrroouunndd(double) double ttrruunncc(double)

These functions provide various means to round floating-point values to

integral values. They are correctly rounded. double ffmmoodd(double, double) double rreemmaaiinnddeerr(double, double) double rreemmqquuoo(double x, double y, int *)

These return a remainder of the division of x by y with an integral quo-

tient. rreemmqquuoo() additionally provides access to a few lower bits of the quotient. They are correctly rounded. double ffddiimm(double, double) double ffmmaaxx(double, double) double ffmmiinn(double, double) ffmmaaxx(x, y) and ffmmiinn(x, y) return the maximum and minimum of x and y, respectively. ffddiimm(x, y) returns the positive difference of x and y. All are correctly rounded. double ffmmaa(double x, double y, double z) ffmmaa(x, y, z) computes the value (x*y) + z as though without intermediate rounding. It is correctly rounded. double ffaabbss(double) double ssqqrrtt(double) double ccbbrrtt(double) double hhyyppoott(double, double) ffaabbss(x), ssqqrrtt(x), and ccbbrrtt(x) return the absolute value, square root, and cube root of x, respectively. hhyyppoott(x, y) returns sqrt(x*x + y*y). ffaabbss() and ssqqrrtt() are correctly rounded. double eexxpp(double) double eexxpp22(double) double eexxppmm11(double)

eexxpp(x), eexxpp22(x), and eexxppmm11(x) return e**x, 2**x, and e**x - 1, respec-

tively. double lloogg(double) double lloogg22(double) double lloogg1100(double) double lloogg11pp(double)

lloogg(x), lloogg22(x), and lloogg1100(x) return the natural, base-2, and base-10

logarithms of x, respectively. lloogg11pp(x) returns the natural log of 1+x. double llooggbb(double) int iillooggbb(double) llooggbb(x) and iillooggbb(x) return the exponent of x. double mmooddff(double, double *) double ffrreexxpp(double, int *) mmooddff(x, &y) returns the fractional part of x and stores the integral part in y. ffrreexxpp(x, &n) returns the mantissa of x and stores the exponent in n. They are correctly rounded. double llddeexxpp(double, int) double ssccaallbbnn(double, int) double ssccaallbbllnn(double, long int) llddeexxpp(x, n), ssccaallbbnn(x, n), and ssccaallbbllnn(x, n) return x*2**n. They are correctly rounded. double ppooww(double, double) ppooww(x,y) returns x raised to the power y. double ccooss(double) double ssiinn(double) double ttaann(double) ccooss(x), ssiinn(x), and ttaann(x) return the cosine, sine and tangent of x, respectively. double ccoosshh(double) double ssiinnhh(double) double ttaannhh(double) ccoosshh(x), ssiinnhh(x), and ttaannhh(x) return the hyperbolic cosine, hyperbolic sine and hyperbolic tangent of x, respectively. double aaccooss(double) double aassiinn(double) double aattaann(double) double aattaann22(double, double) aaccooss(x), aassiinn(x), and aattaann(x) return the inverse cosine, inverse sine and

inverse tangent of x, respectively. aattaann22(y, x) returns the inverse tan-

gent of y/x, with sign chosen according to the quadrant of (x,y). double aaccoosshh(double) double aassiinnhh(double) double aattaannhh(double) aaccoosshh(x), aassiinnhh(x), and aattaannhh(x) return the inverse hyperbolic cosine,

inverse hyperbolic sine and inverse hyperbolic tangent of x, respec-

tively. double ttggaammmmaa(double) double llggaammmmaa(double) ttggaammmmaa(x) and llggaammmmaa(x) return the values of the gamma function and its logarithm evalutated at x, respectively. double jj00(double) double jj11(double) double jjnn(double) double yy00(double) double yy11(double) double yynn(double) jj00(x), jj11(x), and jjnn(x) return the values of the zeroth, first, and nth Bessel function of the first kind evaluated at x, respectively. yy00(x), yy11(x), and yynn(x) return the values of the zeroth, first, and nth Bessel function of the second kind evaluated at x, respectively. double eerrff(double) double eerrffcc(double)

eerrff(x) and eerrffcc(x) return the values of the error function and the com-

plementary error function evaluated at x, respectively. MMAATTHHEEMMAATTIICCAALL CCOONNSSTTAANNTTSS

In addition to the functions listed above, math.h defines a number of

useful constants, listed below. All are defined as C99 floating-point

constants. CONSTANT VALUE ME base of natural logarithm, e MLOG2E log2(e) MLOG10E log10(e) MLN2 ln(2) MLN10 ln(10) MPI pi MPI2 pi / 2 MPI4 pi / 4 M1PI 1 / pi M2PI 2 / pi M2SQRTPI 2 / sqrt(pi) MSQRT2 sqrt(2) MSQRT12 sqrt(1/2)

IIEEEEEE SSTTAANNDDAARRDD 775544 FFLLOOAATTIINNGG-PPOOIINNTT AARRIITTHHMMEETTIICC

The libm functions declared in math.h provide mathematical library func-

tions in single-, double-, and extended-precision IEEE-754 floating-point

formats on Intel macs, and in single- and double-precision IEEE-754

floating-point formats on PowerPC macs.

SEE ALSO

float(3), complex(3) STANDARDS

The functions conform to the ISO/IEC 9899:1999(E) standard.

BSD March 20, 2007 BSD




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™