How to use scalbln() function to multiply a floating point by FLT_RADIX raised to power of long int N in C

1 Answer

0 votes
#include <stdio.h>     
#include <math.h>
#include <float.h>
 
int main(int argc, char **argv)
{   
	double x = 2.30;
	long n = 5;
	double result = scalbln(x , n);
	
	printf("scalbln(2.30 , 5) : %f * %d^%ld = %f\n", x, FLT_RADIX, n, result);
  
    return 0;
}
 
/*
run:
   
scalbln(2.30 , 5) : 2.300000 * 2^5 = 73.600000

*/

 



answered Mar 29, 2016 by avibootz
...