scalb(3M)
NAME
scalb() − load exponent of a radix-independent floating-point number
SYNOPSIS
#include <math.h>
double scalb(double x, double n);
DESCRIPTION
The scalb() function returns x ∗ rn, where r is the radix of the machine’s floating-point arithmetic. When r is 2, scalb() is equivalent to ldexp().
To use this function, link in the math library by specifying −lm on the compiler or linker command line.
RETURN VALUE
Upon successful completion, the scalb() function returns x ∗ rn.
If x is NaN, scalb() returns NaN.
If x is ±INFINITY, scalb() returns x.
If the correct value would overflow, scalb() returns ±HUGE_VAL (according to the sign of x) and sets errno to [ERANGE].
If the correct value after rounding would be smaller in magnitude than MINDOUBLE, scalb() returns zero and sets errno to [ERANGE].
ERRORS
If scalb() fails, errno is set to one of the following values.
[ERANGE] The correct value would overflow.
[ERANGE] The correct value after rounding would be smaller in magnitude than MINDOUBLE.
SEE ALSO
isinf(3M), isnan(3M), ldexp(3M), values(5).
STANDARDS CONFORMANCE
scalb(): SVID3, XPG4.2
Hewlett-Packard Company — HP-UX Release 10.20: July 1996