"Для разработчиков", "Серверные скрипты", "Описание функций", "Математические", "Exp".
Вычислить экспоненту от числа.
function Exp(x: extended): extended;
Параметр |
Тип |
Значение |
---|---|---|
x |
extended |
число, от которого нужно вычислить экспоненту. |
Значение экспоненты.
function Power(y, x: integer): int64;
begin
result := round(Exp(x * Ln(y)));
end;
var
i: integer;
begin
for i := 1 to 16 do
mLogScript(inttostr(Power(2, i)), '2^' + inttostr(i));
end.
[21:47:02] (Log "Exp"): [2^1] 2
[21:47:02] (Log "Exp"): [2^2] 4
[21:47:02] (Log "Exp"): [2^3] 8
[21:47:02] (Log "Exp"): [2^4] 16
[21:47:02] (Log "Exp"): [2^5] 32
[21:47:02] (Log "Exp"): [2^6] 64
[21:47:02] (Log "Exp"): [2^7] 128
[21:47:02] (Log "Exp"): [2^8] 256
[21:47:02] (Log "Exp"): [2^9] 512
[21:47:02] (Log "Exp"): [2^10] 1024
[21:47:02] (Log "Exp"): [2^11] 2048
[21:47:02] (Log "Exp"): [2^12] 4096
[21:47:02] (Log "Exp"): [2^13] 8192
[21:47:02] (Log "Exp"): [2^14] 16384
[21:47:02] (Log "Exp"): [2^15] 32768
[21:47:02] (Log "Exp"): [2^16] 65536
[21:47:02] (Run "Exp"): Время выполнения скрипта: 5 мс
[21:47:02] (Run "Exp"): Скрипт выполнен успешно.