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 <iostream>
#include <cmath>
#include <cfloat>

using namespace std;

int main()
{
	double x = 2.30;
	long n = 5;
	double result = scalbln(x, n);

	cout << "scalbln(2.30 , 5) : " << x << " * " << FLT_RADIX << "^" << n << " = " << result;

	return 0;
}

/*
run:

scalbln(2.30 , 5) : 2.3 * 2^5 = 73.6

*/

 



answered Mar 29, 2016 by avibootz
...