Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl - load exponent of base-independent floating-point number

&pagelevel(4)&pagelevel

Syntax

#include <math.h>

C11 double scalbn(double x, int n);
float scalbnf(float x, int n);
long double scalbnl(long x, int n);
double scalbln(double x, long n);
float scalblnf(float x, long n);
long double scalblnl(long double x, long n); (End)

Description

These functions compute x*r n, where r is the base of the machine-dependent floating-point arithmetic, without computing rn explicitly. For r=2, scalb() is equivalent to ldexp().

Return val.

x *r n

if successfull.

 

+/-HUGE_VAL
+/-HUGE_VALF
+/-HUGE_VALL

depending on the function type and the sign of x, if an overflow occurs.
errno is set to indicate the error.

 

0

if scalb() causes an underflow. errno is set to ERANGE.

Errors

scalbn(), scalbnf(), scalbnl(), scalbln(), scalblnf() and scalblnl() will fail if:


ERANGE      

overflow or underflow.

Notes

An application that wants to check the error situation should set errno to 0 before the function is called. If on the return errno is then not equal to zero, this signals an error.

For BS2000 the base is r=16.

See also

ldexp(), scalb(), math.h.