scalb, scalbf, scalbl - multiply floating-point number by integral power of radix (OBSOLETE)

Synopsis

Description

Return Value

Errors

Colophon

#include <math.h>

double scalb(doublex, doubleexp);

float scalbf(floatx, doubleexp);

long double scalbl(long doublex, doubleexp);Link with

-lm.Feature Test Macro Requirements for glibc (see

feature_test_macros(7)):

scalb():_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED

scalbf(),scalbl():_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600

These functions multiply their first argumentxbyFLT_RADIX(probably 2) to the power ofexp, that is:x * FLT_RADIX ** exp

The definition of

FLT_RADIXcan be obtained by including<float.h>.

On success, these functions returnx*FLT_RADIX**exp.If

xorexpis a NaN, a NaN is returned.If

xis positive infinity (negative infinity), andexpis not negative infinity, positive infinity (negative infinity) is returned.If

xis +0 (-0), andexpis not positive infinity, +0 (-0) is returned.If

xis zero, andexpis positive infinity, a domain error occurs, and a NaN is returned.If

xis an infinity, andexpis negative infinity, a domain error occurs, and a NaN is returned.If the result overflows, a range error occurs, and the functions return

HUGE_VAL,HUGE_VALF, orHUGE_VALL, respectively, with a sign the same asx.If the result underflows, a range error occurs, and the functions return zero, with a sign the same as

x.

Seemath_error(7) for information on how to determine whether an error has occurred when calling these functions.The following errors can occur:

These functions do not set

Domain error: xis 0, andexpis positive infinity,or xis positive infinity andexpis negative infinity and the other argument is not a NaN An invalid floating-point exception (FE_INVALID) is raised.Range error, overflow An overflow floating-point exception ( FE_OVERFLOW) is raised.Range error, underflow An underflow floating-point exception ( FE_UNDERFLOW) is raised.errno.

scalb() is specified in POSIX.1-2001, but marked obsolescent. POSIX.1-2008 removes the specification ofscalb(), recommending the use ofscalbln(3),scalblnf(3), orscalblnl(3) instead. Thescalb() function is from 4.3BSD.

scalbf() andscalbl() are unstandardized;scalbf() is nevertheless present on several other systems

ldexp(3),scalbln(3)

This page is part of release 3.44 of the Linuxman-pagesproject. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/.

SCALB (3) | 2010-09-20 |