Power function
Return real power.
Declaration
function Power(base: Float; exponent: Float): FloatDescription
power raises
base to the power of
exponent.
This is equivalent to
exp(ln(base)*exponent).
However, for integer
exponent values
intpower is called.
Otherwise
base must be non-negative.Errors
Any number of floating point math exceptions may be raised, if they are not masked by SetExceptionMask.
See also
Example: ex34
Program Example34;
{ Program to demonstrate the power function. }
Uses Math;
procedure dopower(x,y : float);
begin
writeln(x:8:6,'^',y:8:6,' = ',power(x,y):8:6)
end;
begin
dopower(2,2);
dopower(2,-2);
dopower(2,0.0);
end.An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
