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

Power

Raise float to integer power

Declaration

Source position: system.fpd line 74

function Power(

  Base: Double;

  expon: Double

):Double;

function Power(

  Base: LongInt;

  expon: LongInt

):LongInt;

Description

Power returns the value of base to the power expon. Base and expon can be of type Longint, in which case the result will also be a Longint.

The function actually returns Exp(expon*Ln(base))

Errors

None.

See also

Exp

  

Exponentiate

Ln

  

Calculate logarithm

Example

Program Example78;

{ Program to demonstrate the Power function. }

begin
  Writeln (Power(exp(1.0),1.0):8:2); { Should print 2.72 }
end.

Documentation generated on: Nov 14 2015