Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ frexp(3C) — GL1 W2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fpsignal(3C)

FREXP(3C)  —  Silicon Graphics

NAME

frexp, _lfrexp, ldexp, _lldexp, modf, _lmodf − manipulate parts of floating-point numbers

SYNOPSIS

float frexp (value, eptr)
float value;
int ∗eptr;

long float _lfrexp (value, eptr)
long float value;
int ∗eptr;

float ldexp (value, exp)
float value;
int exp;

long float _lldexp (value, exp)
long float value;
int exp;

float modf (value, iptr)
float value, ∗iptr;

long float _lmodf (value, iptr)
long float value, ∗iptr;

DESCRIPTION

Every non-zero number can be written uniquely as x∗ 2n, where the “mantissa” (fraction) x is in the range 0.5 ≤ |x| < 1.0, and the “exponent” n is an integer.  Frexp (_lfrexp) returns the mantissa of a floating point value, and stores the exponent indirectly in the location pointed to by eptr.

Ldexp (_lfrexp) returns the quantity value∗ 2exp.

Modf (_lmodf) returns the signed fractional part of value and stores the integral part indirectly in the location pointed to by iptr.

DIAGNOSTICS

If ldexp (_lldexp) would cause overflow, a floating point exception is signalled with the type OVERFL. Underflow is similarly signalled by the type UNDERFLOW_A.

If frexp (_lfrexp) or modf (_lmodf) is passed infinity or NaN as a value, it will signal a floating point exception with the type CONVERT_INFINITY for infinity or INVALID_OP_A for NaN.  As ldexp (_lldexp) calls frexp (_lfrexp), this exception can also occur when calling ldexp (_lldexp) if the passed value is infinite or Nan. 

SEE ALSO

fpsignal(3C). 

Version 2.3  —  July 04, 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026