December 2005
Beginner to intermediate
618 pages
20h 19m
English
scalbln, scalbn
Multiplies a floating-point number by a power of the floating-point radix
#include <math.h> doublescalbn( doublex, intn); floatscalbnf( floatx, intn); long doublescalbnl( long doublex, intn); doublescalbln( doublex, long intn); floatscalblnf( floatx, long intn); long doublescalblnl( long doublex, long intn);
The scalbn() and scalbln() functions multiply a
floating-point number x by an integer
power of FLT_RADIX, providing a
more efficient calculation than the arithmetic operators. The
symbolic constant FLT_RADIX,
defined in float.h, indicates
the base of the floating-point environment’s exponent
representation; this is usually 2, for binary exponent
representation. In this case, the return value of the scalbn() and scalbln() functions is
x × 2n.
See the example for feholdexcept() in this
chapter.
Read now
Unlock full access