frexpf, frexpl, or frexp Subroutine

Purpose

Extracts the mantissa and exponent from a double precision number.

Syntax

#include <math.h>

float frexpf (num, exp)
float num;
int *exp;

long double frexpl (num, exp)
long double num;
int *exp;

double frexp (num, exp)
double num;
int *exp;

Description

The frexpf, frexpl, and frexp subroutines break a floating-point number num into a normalized fraction and an integral power of 2. The integer exponent is stored in the int object pointed to by exp.

Parameters

Item Description
num Specifies the floating-point number to be broken into a normalized fraction and an integral power of 2.
exp Points to where the integer exponent is stored.

Return Values

For finite arguments, the frexpf, frexpl, and frexp subroutines return the value x, such that x has a magnitude in the interval [½ ,1) or 0, and num equals x times 2 raised to the power exp.

If num is NaN, a NaN is returned, and the value of *exp is unspecified.

If num is ±0, ±0 is returned, and the value of *exp is 0.

If num is ±Inf, num is returned, and the value of *exp is unspecified.