This shows you the differences between two versions of the page.
cpp:cmath:pow [2013/04/16 03:26] 64.134.43.113 |
cpp:cmath:pow [2024/02/16 01:04] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
====== pow ====== | ====== pow ====== | ||
<code cpp> | <code cpp> | ||
- | float pow(float , float ); | + | float pow(float base, float exponent); |
- | double pow(double, double); | + | double pow(double base, double exponent); |
- | double pow(double, int ); | + | double pow(double base, int exponent); |
</code> | </code> | ||
Line 21: | Line 21: | ||
cout.precision(8); | cout.precision(8); | ||
- | cout << "4 to the 2th power is: " << pow(4, 2) << endl; | + | cout << "4 raised to the 2nd power is: " << pow(4, 2) << endl; |
return 0; | return 0; | ||
} | } | ||
Line 28: | Line 29: | ||
==== output ==== | ==== output ==== | ||
- | 4 to the 2th power is: 16 | + | 4 raised to the 2nd power is: 16 |