scalbn.3m (2010 09)

s
scalbn(3M) scalbn(3M)
NAME
scalbn(), scalbnf(), scalbnl(), scalbnq(), scalbnw() - scale exponent of a radix-independent floating-point
number
SYNOPSIS
#include <math.h>
double scalbn(double x, int n);
HP Integrity Servers Only
float scalbnf(float x, int n);
long double scalbnl(long double y, int n);
extended scalbnw(extended x, int n);
quad scalbnq(quad 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 and Integrity servers),
scalbn() computes the same value as
ldexp().
Integrity Servers Only
scalbnf() is a float version of scalbn(); it takes a float first argument and returns a
float
result.
scalbnl() is a long double version of scalbn(); it takes a long double first argument and
returns a long double result.
scalbnw() is an extended version of scalbn(); it takes an extended first argument and returns
an extended result.
scalbnq() is equivalent to scalbnl() on HP-UX systems.
USAGE
To use these functions compile either with the default
-Ae option or with the
-Aa and
-D_HPUX_SOURCE options.
To use (for Integrity servers)
scalbnw() or scalbnq(), compile also with the -fpwidetypes
option.
Make sure your program includes
<math.h>. Link in the math library by specifying -lm on the com-
piler or linker command line.
For more information, see the HP-UX floating-point guide for HP Integrity servers at the following site:
http://www.hp.com/go/fp
.
RETURN VALUE
scalbn(-x, n) and -scalbn(x, n) are equivalent.
If x is ±INFINITY, zero, or a NaN,
scalbn() returns x.
scalbn() returns a properly signed infinity in lieu of a value whose magnitude is too large, and raises
the overflow and inexact exceptions.
scalbn() raises the underflow and inexact exceptions whenever a result is tiny (essentially denormal or
zero) and thereby suffers loss of accuracy, and may raise those exceptions if the result is merely tiny.
ERRORS
No errors are defined.
SEE ALSO
ilogb(3M), ldexp(3M), logb(3M), scalb(3M), scalbln(3M), math(5).
STANDARDS CONFORMANCE
scalbn(), scalbnf(), scalbnl(): ISO/IEC C99 (including Annex F, "IEC 60559 floating-point
arithmetic")
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)