frexp(3C)

frexp, ldexp, logb, ilogb, modf, modff, nextafter, scalb, frexpl, ldexpl, logbl, modfl, nextafterl, scalbl, nearbyint, nearbyintf, nearbyintl, nexttoward, nexttowardf, nexttowardl - manipulate parts of floating-point numbers (libc routines)

As shipped in IRIX 6.5.19. Last changed in IRIX 6.5.19.

NAME
     frexp, ldexp, logb, ilogb, modf, modff, nextafter, scalb, frexpl, ldexpl,
     logbl, modfl, nextafterl, scalbl, nearbyint, nearbyintf, nearbyintl,
     nexttoward, nexttowardf, nexttowardl - manipulate parts of floating-point
     numbers (libc routines)

SYNOPSIS
     #include <math.h>

     double frexp (double value, int *eptr);

     double ldexp (double value, int exp);

     double logb (double value);

     int ilogb (double value);

     double nextafter (double value1, double value2);

     double scalb (double value, double exp);

     double modf (double value, double *iptr);

     float modff (float value, float *iptr);

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

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

     long double logbl (long double value);

     long double nextafterl (long double value1, long double value2);

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

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

     double nearbyint(double x);

     float nearbyintf(float x);

     long double nearbyintl(long double x);

     double nexttoward(double x, long double y);

     float nexttowardf(float x, long double y);
     double nexttowardl(long double x, long double y);

DESCRIPTION
     (Note that the long double routines are only valid for the MIPSpro
     compilers.)  Long double functions have been renamed to be compliant with
     the ANSI-C standard, however to be backward compatible, they may still be
     called with the double precision function name prefixed with a q.

     Every non-zero 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.  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, and stores the
     exponent indirectly in the location pointed to by eptr.  If value is
     zero, both results returned by frexpl are zero.

     ldexp and scalb return the quantity value*2**exp.  The only difference
     between the two is that scalb of a signaling NaN will result in the
     invalid operation exception being raised.  Users should note that routine
     scalb in libm43 with prototype

     double scalb (double value, int exp)

     conflicts with the above definition of scalb.  If it is necessary to call
     the libc version of scalb in this situation, the strong name _scalb
     should be used.

     ldexpl and scalbl return the quantity value*2**exp.  The only difference
     between the two is that 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.

     ilogb returns the unbiased exponent of its floating-point argument as an
     integer value.  The call ilogb(x) is equivalent to (int)logb(x).

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

     modf, modff (single-precision version) and modfl (long double-precision
     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.

     nextafterl returns the next representable long double-precision
     floating-point value following value1 in the direction of value2.

NOTES
     If a C99 program that uses clog is linked with a C++ program that
     includes the iostream.h header (the old iostream library), that program
     cannot use the stream called clog.
     Long double operations on this system are only supported in round to
     nearest rounding mode (the default).  The system must be in round to
     nearest rounding mode when calling any of the long double functions, or
     incorrect answers will result.

     Users concerned with portability to other computer systems should note
     that the long double and float versions of these functions were optional
     according to the ANSI C Programming Language Specification ISO/IEC 9899 :
     1990 (E) and are no longer optional according to ISO/IEC 9899:1999(E).

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

DIAGNOSTICS
     If ldexp or ldexpl would cause overflow, _HUGE_VAL (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, the default
     quiet NaN is returned and errno is set to EDOM.  If the input value to
     ldexp or ldexpl is Infinity, Infinity is returned and errno is set to
     ERANGE.  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 and logbl of NaN returns that NaN, logb and logbl of infinity return
     positive infinity, and logb and logbl of zero return negative infinity
     and result in the raising of the divide by zero exception.  In each of
     these conditions errno is set to EDOM.

     ilogb of NaN or zero returns INT_MIN, ilogb of +infinity or -infinity
     returns INT_MAX.  In each of these conditions errno is not set.

     If input value1 to nextafter or nextafterl 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) or nextafterl(value1, value2) is not. The
     underflow and inexact exceptions are signalled when nextafter(value1,
     value2) lies strictly between _2**-1022 or nextafterl(value1, value2)
     lies strictly between _2**-916.  In these cases errno is also set to
     ERANGE.