Script Name: Exp
Script Description: Calculates the Exponential Function
Original Author(s): Zakath
Core Version: 2.6.3
Code:
const
EXPRECISION = 25; // the higher number the better precision and the more calculations(cputime)
function Exp(Exponent: double): double;
var
i, j: integer;
numerator, denominator: double;
begin
Result := 1;
for i:= 1 to EXPPRECISION do
begin
denominator := 1;
numerator := 1;
for j:= 1 to i do
begin
denominator := denominator * j;
numerator := numerator * Exponent;
end;
Result := Result + numerator/denominator;
end;
end;