Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference (Volume 7 of 9): Section 3: Library Functions (N-Z) > s

scalbn(3M)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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 * rn, 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 * rn.

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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2000 Hewlett-Packard Development Company, L.P.