The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 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 computes x * rn, where r is the radix of the machine's floating point arithmetic. When r is 2, scalb() is equivalent to ldexp().

An application wishing to check for error situations should set errno to 0 before calling scalb(). If errno is non-zero on return, or the return value is NaN, an error has occurred.

 RETURN VALUE

Upon successful completion, the scalb() function returns x * rn.

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 would underflow, scalb() returns 0 and sets errno to [ERANGE].

The scalb() function returns x when x is ±Inf.

If x or n is NaN, then scalb() returns NaN and may set errno to [EDOM].

 ERRORS

The scalb() function will fail if:
[ERANGE]
The correct value would overflow or underflow.

The scalb() function may fail if:

[EDOM]
The x or n argument is NaN.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

ldexp(), <math.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]