scalbln - C math.h

C examples for math.h:scalbln

Type

function

From

<cmath>
<ctgmath>
<math.h>

Description

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 

Prototype

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); 

Parameters

Parameter Description
x Value representing the significand.
exp Value of the exponent.

Return Value

Returns x * FLT_RADIX ^ n.

Demo Code


#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;
}

Related Tutorials