C examples for math.h:scalbln
function
<cmath> <ctgmath> <math.h>
Scale significand using floating-point base exponent (long)
Scales x by FLT_RADIX raised to the power of n, returning the result of computing:
scalbn(x,n) = x * FLT_RADIX ^ n
long double scalblnl (long double x, long int n); long double scalbln (long double x, long int n); double scalbln (double x , long int n); float scalblnf (float x , long int n); float scalbln (float x , long int n); double scalbln (T x , long int n);
Parameter | Description |
---|---|
x | Value representing the significand. |
exp | Value of the exponent. |
Returns x * FLT_RADIX ^ n.
#include <stdio.h> #include <float.h> #include <math.h> int main ()//from www . java2 s . co m { double param = 1.50; int n = 4L; double result = scalbln (param , n); printf ("%f * %d^%d = %f\n", param, FLT_RADIX, n, result); return 0; }