This shows you the differences between two versions of the page.
|
cpp:cmath:pow [2012/10/12 18:35] 127.0.0.1 external edit |
cpp:cmath:pow [2024/02/16 01:04] (current) |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ====== pow ====== | ====== pow ====== | ||
| <code cpp> | <code cpp> | ||
| - | double pow(double, double ); | + | float pow(float base, float exponent); |
| + | double pow(double base, double exponent); | ||
| + | double pow(double base, int exponent); | ||
| </code> | </code> | ||
| Line 19: | 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 26: | Line 29: | ||
| ==== output ==== | ==== output ==== | ||
| - | 4 to the 2th power is: 16 | + | 4 raised to the 2nd power is: 16 |