help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions] Reference for unit 'math' (#rtl)

power

Return real power.

Declaration

Source position: math.pp line 310

function power(

  base: float;

  exponent: float

):float;

Description

power raises base to the power power. This is equivalent to exp(power*ln(base)). Therefore base should be non-negative.

Errors

None.

See also

intpower

  

Return integer power.

Example

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.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505