scalbn(x,n) = x * ( FLT_RADX)n
float scalbln(float x, long int n); double scalbln(double x, long int n); long double scalbln(long double x, long int n); double scalbln(integral x, long int n);
#include <iostream> #include<math.h> #include<float.h> using namespace std; int main() { int x=3; long n=3L; std::cout << "Value of x is: " <<x<< std::endl; cout<<"3 * 2^3 = "<<scalbn(x,n); return 0; }
Value of x is: 3 3 * 2^3 = 24
#include <iostream> #include<math.h> #include<float.h> using namespace std; int main() { float x=7.2; long n=2L; std::cout << "Value of x is : " <<x<< std::endl; cout<<"7.2 * 2^2 = "<<scalbln(x,n); return 0; }
Value of x is : 7.2 7.2 * 2^2 = 28.8