Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ frexp(3) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sgetl, sputl

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 S 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 value param-
     eter and stores  the exponent in the  location pointed to
     by the eptr parameter.

     The ldexp subroutine returns the quantity mant S 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 sets
     errno to ERANGE.

     Related Information

     In this book:  "sgetl, sputl."

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