The scalbln() is a built-in function in C++ STL which takes two arguments and scales x by FLT_RADIX raised to the power n. The function returns the product of x and FLT_RADIX raised to the power n.
FLT_RADIX: It is the value of the radix (integer base) of the exponent representation.
scalbln (x, n)
Parameters: The function accepts two mandatory parameters which are described below:
- x– It specifies the value representing the significand. The data-type can be double, float or long-double.
- n– It specifies the exponent of FLT_RADIX. The parameter is of data-type long-int.
Return Type: The function returns the product of x and FLT_RADIX raised to the power n. The returned value is of the same data-type as of x.
Below programs illustrate the above function:
2.12 * 2^0 = 2.12
19.8 * 2^9999999 = inf
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- div() function in C++
- fma() function in C++
- exp() function C++
- log() function in C++
- set emplace_hint() function in C++ STL
- set count() function in C++ STL
- set equal_range() function in C++ STL
- set find() function in C++ STL
- set max_size() function in C++ STL
- set insert() function in C++ STL
- set upper_bound() function in C++ STL
- set lower_bound() function in C++ STL
- ratio_less() function in 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 firstname.lastname@example.org. 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.