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