[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

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

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.

Related Information

class, _class, finite, isnan, or unordered Subroutines and modf, modff, or modfl Subroutine

math.h in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]