MicrOS
frexp.c File Reference
#include "../math.h"

Functions

double frexp (double x, int *exp)
 Get significand and exponent. More...
 

Function Documentation

◆ frexp()

double frexp ( double  x,
int *  exp 
)

Get significand and exponent.

The frexp functions break a floating-point number into a normalized fraction and an integral power of 2. They store the integer in the int object pointed to by exp.

Parameters
xValue to be decomposed.
expPointer to an int where the value of the exponent is stored.
Returns
If value is not a floating-point number or if the integral power of 2 is outside the range of int, the results are unspecified. Otherwise, the frexp functions return the value x, such that x has a magnitude in the interval [1/2, 1) or zero, and value equals x × 2^exp. If value is zero, both parts of the result are zero.