You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
program Project1;
{$APPTYPE CONSOLE}{$R *.res}uses
System.SysUtils;
functionFastInvSqrt(x: single): single;
var
i: integer;
y: single;
begin
i := PInteger(@x)^;
i := $5f3759df - (i shr1);
y := PSingle(@i)^;
Result := y * (1.5 - 0.5 * x * y * y);
end;
var
line: string;
f: single;
begintry{ TODO -oUser -cConsole メイン : ここにコードを記述してください }repeat
Readln(line);
if line = ''then Break;
if Single.TryParse(line, f) thenbegin
Writeln(FastInvSqrt(f));
end;
until false;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
The text was updated successfully, but these errors were encountered:
手元にgit入れてなく、hatenaアカウントももっていないため、Issueで失礼します。
試しにDelphiのコード書いてみました・・・
というかほぼCそのままの写しで済んでしまったわけですが・・・。
The text was updated successfully, but these errors were encountered: