Double-precision floating point (±1.7E±308, ~15 decimal digits)
1st Parameter
The base value to be raised to the power of `exponent`.
2nd Parameter Type : double
Double-precision floating point (±1.7E±308, ~15 decimal digits)
2nd Parameter
The exponent value to which the base is raised.
Read more about parameters of pow in parameters section
The powfunction in C language Calculates the power of one number raised to another, i.e., base raised to the exponent.
The pow function computes the value of base raised to the power of exponent. It handles various special cases, including negative and fractional exponents. For integer exponents, consider using specialized functions or manual multiplication for better performance.
The powfunction takes 2
parameters:
•
double `base`: The base value to be raised to the power of `exponent`.
•
double `exponent`: The exponent value to which the base is raised.
Computes the value of `base` raised to the power of `exponent`, i.e., base^exponent. Returns the result as a `double`. Handles special cases such as 0 raised to any power, negative bases with non-integer exponents, and overflows or underflows, returning values like ±infinity or 0 where appropriate.
The pow function return value :
Returns base raised to the power of exponent
If the result is too large or too small to be represented as a double, it may return HUGE_VAL, HUGE_VALF, or HUGE_VALL, signed appropriately
Output
This example demonstrates how to use pow for integer and fractional exponents. It shows calculating a regular power and a square root.