5.5. Exponential and Logarithmic Functions

5.5.1. The exp function

Synopsis
#include <math.h>

double exp (double x );

Description

The exp function computes the exponential function of x. A range error occurs if the magnitude of x is too large.

Returns

The exp function returns the exponential value.

5.5.2. The frexp function

Synopsis
#include <math.h>

double frexp (double value , int * exp );

Description

The frexp function breaks a floating-point number into a normalized fraction and an integral power of 2. It stores the integer in the int object pointed to by exp.

Returns

The frexp function returns the value x, such that x is a double with magnitude in the interval [1/2,1] or zero, and value equals x times 2 raised to the power *exp. If value is zero, both parts of the result are zero.

See Also

Section 5.5.3

5.5.3. The ldexp function

Synopsis
#include <math.h>

double ldexp (double x , int exp );

Description

The ldexp function multiplies a floating point number by an integral power of 2. A range error may occur.

Returns

The ldexp function returns the value of x times 2 raised to the power exp.

See Also

Section 5.5.2

Implementation Notes

None.

5.5.4. The log function

Synopsis
#include <math.h>

double log (double x );

Description

The log function computes the natural logarithm of x. A domain error occurs is the argument is negative. A range error may occur if the argument is zero.

Returns

The log function returns the natural logarithm.

Implementation Notes

5.5.5. The log10 function

Synopsis
#include <math.h>

double log10 (double x );

Description

The log10 function computes the base-ten logarithm of x. A domain error occurs if the argument is negative. A range error may occur if the argument is zero.

Returns

The log10 function returns the base-ten logarithm.

Implementation Notes

5.5.6. The modf function

Synopsis
#include <math.h>

double modf (double value , double * iptr );

Description

The modf function breaks the argument value into integral and fraction parts, each of which has the same sign as the argument. It stores the integral part as a double in the object pointed to by iptr.

Returns

The modf function returns the signed fraction part of value.

Implementation Notes

None.