LDEXP 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

ldexpf, ldexp, ldexpl, ldexpw, ldexpq, ldexpll, ldexpdf, ldexpd, ldexpdl, ldexpdll - load exponent of a floating-point number

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float ldexpf (float x, int n);

extern double ldexp (double x, int n);

extern long double ldexpl (long double x, int n);

extern __float80 ldexpw (__float80 x, int n);

extern __float128 ldexpq (__float128 x, int n);

extern long_long_double ldexpll (long_long_double x, int n);

extern decimal_float ldexpdf (decimal_float x, int n);

extern decimal_double ldexpd (decimal_double x, int n);

extern decimal_long_double ldexpdl (decimal_long_double x, int n);

extern decimal_long_long_double ldexpdll (decimal_long_long_double x, int n);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

For ldexpf(), ldexp(), ldexpl(), and ldexpll(), compute the product of the first argument and two to the power of the second argument exactly when the floating-point base is two.

For octal- and hexadecimal-base systems, these functions are not exact unless the power is a multiple of three (octal) or four (hexadecimal). Use the ldexph() or ldexpo() families instead on such systems.

For ldexpdf(), ldexpd(), ldexpdl(), and ldexpdll(), compute the product of the first argument and ten to the power of the second argument exactly.


RETURN VALUES

Return x * 2**n for binary bases, and x * 10**n for base 10.

ERRORS

If the first argument is +Infinity, -Infinity, or a NaN, the result is that argument. If the product would overflow, the result is Infinity with the sign of the first argument. However, errno is never set.

SEE ALSO

frexp(3CW), frexph(3CW), frexpo(3CW), ldexph(3CW), ldexpo(3CW), logb(3CW).