xref: /original-bsd/lib/libc/gen/frexp.3 (revision a9c19d04)
@(#)frexp.3 6.3 (Berkeley) 04/13/87

FREXP 3 ""
.AT 3
NAME
frexp, ldexp, modf - split into mantissa and exponent
SYNOPSIS
 double frexp(value, eptr)  double value;  int *eptr; 

double ldexp(value, exp) double value;

double modf(value, iptr) double value, *iptr;

DESCRIPTION
Every nonzero number can be written uniquely as where the ``mantissa'' (fraction) x is in the range 0.5 <= |x| < 1.0, and the ``exponent'' n is an integer. Frexp returns the mantissa of a double value, and stores the exponent indirectly in the location pointed to by eptr. If value is 0, both results returned by frexp are 0.

Ldexp returns the quantity

Modf returns the signed fractional part of value and stores the integer part indirectly in the location pointed to by iptr.

DIAGNOSTICS
If ldexp would cause overflow, HUGE is returned and errno is set to ERANGE.