Return integer power.
Source position: math.pp line 600
function IntPower( |
base: Float; |
exponent: LongInt |
):Float; |
Intpower returns base to the power exponent, where exponent is an integer value.
If base is zero and the exponent is negative, then an overflow error will occur.
|
Return real power. |
Program Example18; { Program to demonstrate the intpower function. } Uses math; Procedure DoIntpower (X : extended; Pow : Integer); begin writeln(X:8:4,'^',Pow:2,' = ',intpower(X,pow):8:4); end; begin dointpower(0.0,0); dointpower(1.0,0); dointpower(2.0,5); dointpower(4.0,3); dointpower(2.0,-1); dointpower(2.0,-2); dointpower(-2.0,4); dointpower(-4.0,3); end.