Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ frexp(3C) — Dell System V Release 4 Issue 2.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

intro(3M)



frexp(3C)       UNIX System V(C Programming Language Utilities)       frexp(3C)


NAME
      frexp, frexpl, ldexp, ldexpl, logb, modf, modff, modfl, nextafter, scalb,
      scalbl - manipulate parts of floating-point numbers

SYNOPSIS
      #include <math.h>

      double frexp (double value, int *eptr);

      long double frexpl (long double value, int *eptr);

      double ldexp (double value, int exp);

      long double ldexpl (long double value, int exp);

      double logb (double value);

      double nextafter (double value1, double value2);

      double scalb (double value, double exp);

      long double scalbl (long double value, double exp);

      double modf (double value, double *iptr);

      float modff (float value, float *iptr);

      long double modfl (long double value, long double *iptr);

DESCRIPTION
      Every non-zero number can be written uniquely as x* 2n, where the
      ``mantissa'' 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.  frexpl returns the
      mantissa of a long double value.

      ldexp, ldexpl, scalb, and scalbl return the quantity value* 2exp.  The
      only difference is that scalb and scalbl of a signaling NaN will result
      in the invalid operation exception being raised.

      logb returns the unbiased exponent of its floating-point argument as a
      double-precision floating-point value.

      modf, modff (single-precision version), and modfl (long double version)
      return the signed fractional part of value and store the integral part
      indirectly in the location pointed to by iptr.

      nextafter returns the next representable double-precision floating-point
      value following value1 in the direction of value2.  Thus, if value2 is
      less than value1, nextafter returns the largest representable floating-
      point number less than value1.


10/89                                                                    Page 1







frexp(3C)       UNIX System V(C Programming Language Utilities)       frexp(3C)


SEE ALSO
      cc(1), intro(3M).

DIAGNOSTICS
      If ldexp or ldexpl would cause overflow, +HUGE (defined in math.h) is
      returned (according to the sign of value), and errno is set to ERANGE.
      If ldexp or ldexpl would cause underflow, zero is returned and errno is
      set to ERANGE.  If the input value to ldexp or ldexpl is NaN or infinity,
      that input is returned and errno is set to EDOM.  The same error
      conditions apply to scalb and scalbl except that a signaling NaN as input
      will result in the raising of the invalid operation exception.

      logb of NaN returns that NaN, logb of infinity returns positive infinity,
      and logb of zero returns negative infinity and results in the raising of
      the divide by zero exception.  In each of these conditions errno is set
      to EDOM.

      If input value1 to nextafter is positive or negative infinity, that input
      is returned and errno is set to EDOM.  The overflow and inexact
      exceptions are signalled when input value1 is finite, but
      nextafter(value1, value2) is not. The underflow and inexact exceptions
      are signalled when nextafter(value1, value2) lies strictly between
      +2-1022.  In both cases errno is set to ERANGE.

      When the program is compiled with the cc options -Xc or -Xa, HUGEVAL is
      returned instead of HUGE.




























Page 2                                                                    10/89





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