Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ frexp(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sputl, sgetl



FREXP(3,L)                  AIX Technical Reference                  FREXP(3,L)



-------------------------------------------------------------------------------
frexp, ldexp, modf



PURPOSE

Manipulates parts of floating-point numbers.

LIBRARY

Standard C Library (libc.a)

SYNTAX



                double frexp (value, eptr)  double ldexp (mant, exp)
                double value;               double mant;
                int *eptr;                  int exp;

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



DESCRIPTION

Every nonzero number can be written uniquely as x * 2(n), where the mantissa
(fraction), x, is in the range 0.5 <= |x| < 1.0, and the exponent, n, is an
integer.  The internal representation of floating-point numbers uses this fact,
storing a mantissa part and an exponent part.

The frexp subroutine returns the mantissa of the value parameter and stores the
exponent in the location pointed to by the eptr parameter.

The ldexp subroutine returns the quantity mant * 2(exp).

The modf subroutine returns the signed fractional part of the value parameter
and stores the integral part in the location pointed to by the iptr parameter.

If the ldexp subroutine overflows, it returns HUGE and sets errno to ERANGE.

ERROR CONDITIONS

The modf subroutine fails if the following is true:

EDOM      The argument value is NaN.

The ldexp subroutine fails if the following is true:

ERANGE    The value to be returned would have caused an overflow or underflow.



Processed November 7, 1990        FREXP(3,L)                                  1





FREXP(3,L)                  AIX Technical Reference                  FREXP(3,L)




The frexp subroutine fails if the following is true:

EDOM      The argument value is NaN or an infinity.

RELATED INFORMATION

In this book:  "sputl, sgetl."















































Processed November 7, 1990        FREXP(3,L)                                  2



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