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 > S


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


scalbln(), scalblnf(), scalblnl(), scalblnq(), scalblnw() — scale exponent of a radix-independent floating-point number


#include <math.h>

double scalbln(double x, long n);

HP Integrity Servers Only

float scalblnf(float x, long n);

long double scalblnl(long double y, long n);

extended scalblnw(extended x, long n);

quad scalblnq(quad x, long n);


The scalbln() 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 and Integrity servers), scalbln() computes the same value as ldexp().

Integrity Servers Only

scalblnf() is a float version of scalbln(); it takes a float first argument and returns a float result.

scalblnl() is a long double version of scalbln(); it takes a long double first argument and returns a long double result.

scalblnw() is an extended version of scalbln(); it takes an extended first argument and returns an extended result.

scalblnq() is equivalent to scalblnl() on HP-UX systems.


To use these functions compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options.

To use scalblnw() or scalblnq(), compile also with the -fpwidetypes option.

Make sure your program includes <math.h>. Link in the math library by specifying -lm on the compiler 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.


scalbln(-x, n) and -scalbln(x, n) are equivalent.

If x is ±INFINITY, zero, or a NaN, scalbln() returns x.

scalbln() returns a properly signed infinity in lieu of a value whose magnitude is too large, and raises the overflow and inexact exceptions.

scalbln() 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.


No errors are defined.


scalbln(), scalblnf(), scalblnl() : ISO/IEC C99 (including Annex F, "IEC 60559 floating-point arithmetic")

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