Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought



     FREXP(S)                  UNIX System V                  FREXP(S)



     Name
          frexp, ldexp, modf - manipulate parts of floating-point
          numbers

     Syntax
          double frexp (value, eptr)
          double value;
          int *eptr;

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

          double modf (value, iptr)
          double 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
          returns the mantissa of a double value and stores the
          exponent indirectly in the location pointed to by eptr.  If
          value is zero, both results returned by frexp are zero.

          ldexp returns the quantity value* 2exp.

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

     Diagnostics
          If ldexp would cause overflow, _HUGE (defined in <math.h>)
          is returned (according to the sign of value), and errno is
          set to ERANGE.
          If ldexp would cause underflow, zero is returned and errno
          is set to ERANGE.

     Standards Conformance
          frexp, ldexp and modf are conformant with:
          AT&T SVID Issue 2, Select Code 307-127;
          The X/Open Portability Guide II of January 1987;
          ANSI X3.159-198X C Language Draft Standard, May 13,
          1988;
          IEEE POSIX Std 1003.1-1988 with C Standard Language-
          Dependent System Support;
          and NIST FIPS 151-1.

                                                (printed 6/20/89)



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