HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)

s
scalbn(3M) scalbn(3M)
NAME
scalbn() - scale exponent of a radix-independent floating-point number
SYNOPSIS
#include <math.h>
double scalbn(double x, int n);
DESCRIPTION
The scalbn() function returns x r
n
, where r is the radix of the machine’s floating-point arithmetic.
When r is 2 (as it is on all PA-RISC systems),
scalbn() is equivalent to ldexp().
The
scalb() function is recommended by the IEEE-754 standard for floating-point arithmetic. The
ISO/ANSI C committee has approved the
scalbn() function for inclusion in the C9X draft standard.
To use this function, compile either with the default
-Ae option or with the -Aa and -D_HPUX_SOURCE
options. Make sure your program includes <
math.h>. Link in the math library by specifying -lm on the
compiler or linker command line.
RETURN VALUE
Upon successful completion, the
scalbn() function returns x r
n
.
scalbn(-x, n) and -scalbn(x, n) are equivalent.
If x is ±INFINITY, zero, or a NaN,
scalbn() returns x.
If the correct value after rounding would be smaller in magnitude than
MINDOUBLE, scalbn() returns
zero.
If the correct value would overflow,
scalbn() returns ±INFINITY (according to the sign of x).
ERRORS
No errors are defined.
SEE ALSO
scalb(3M), ilogb(3M), ldexp(3M), logb(3M), math(5), values(5).
HP-UX 11i Version 1: September 2005 1 Hewlett-Packard Company Section 3855