C examples for math.h:scalbn
function
<cmath> <ctgmath> <math.h>
Scales x by FLT_RADIX raised to the power of n, returning the same as:
scalbn(x,n) = x * FLT_RADIX ^ n
long double scalbnl (long double x, int n); long double scalbn (long double x, int n); double scalbn (double x , int n); float scalbnf (float x , int n); float scalbn (float x , int n); double scalbn (T x , 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 w w w .j a v a 2s. co m { double param = 1.50; int n = 4; double result = scalbn (param , n); printf ("%f * %d^%d = %f\n", param, FLT_RADIX, n, result); return 0; }