RosettaCodeData/Task/Calculating-the-value-of-e/PascalABC.NET/calculating-the-value-of-e.pas
2024-07-13 15:19:22 -07:00

19 lines
246 B
ObjectPascal

function MyExp(x: real): real;
const eps = 1e-15;
begin
var y := 1.0;
var s := y;
var i := 1;
while y > eps do
begin
y *= x / i;
s += y;
i += 1;
end;
Result := s;
end;
begin
Println(MyExp(1));
Println(Exp(1));
end.