The scalbn() function is defined in the cmath header file. This function is used to calculate the product of given number x and FLT_RADIX raised to the power n.
float scalbn(float x, int n);
double scalbn(double x, int n);
long double scalbn(long double x, int n);
double scalbn(integral x, int n);
Parameters:- This method takes two parameters:
- x: This represents the value of significand.
- n: This represents the value of the exponent.
Return Value: This function returns the product of given number x and FLT_RADIX raised to the power n. with the help of formula:
scalbn(x, n) = x * FLT_RADIXn
Below programs illustrate the above function:-
5 * 2^7 = 640
3.9 * 2^7 = 499
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between user defined function and library function in C/C++
- How to call some function before main() function in C++?
- Function Overloading vs Function Overriding in C++
- How to call function within function in C or C++
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++
- log() function in C++
- exp() function C++
- div() function in C++
- fma() function in C++
- mbsinit() Function in C/C++
- bit_and function in C++
- wcsrchr() function in C/C++
- mbrtowc() function in C/C++
- wcspbrk() function in C/C++
- mbrlen() function in C/C++
- transform_inclusive_scan() function in C++
- wcstol() function in C/C++
- wcstod() function in C/C++
- wcsncat() function in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.