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



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

intpower

Return integer power.

Declaration

Source position: math.pp line 312

function intpower(

  base: float;

  const exponent: Integer

):float;

Description

Intpower returns base to the power exponent, where exponent is an integer value.

Errors

If base is zero and the exponent is negative, then an overflow error will occur.

See also

power

  

Return real power.

Example

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.

Notes

 No notes exist for this page yet. 





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