J
Jacques Oberto
Hello All,
I am in the need of a fast log2 C# routine. Does anyone
have one handy ?
Alternatively, could anybody help translating the
following Delphi routine to C#?
Thanks,
Jacques
---------------
function fastlog2(val:single):single;
var
logg2,x:longint;
begin
x:=longint((@val)^);
logg2:=((x shr 23) and 255)-128;
x:=x and (not(255 shl 23));
x:=x+127 shl 23;
result:=single((@x)^)+logg2;
end;
---------------
I am in the need of a fast log2 C# routine. Does anyone
have one handy ?
Alternatively, could anybody help translating the
following Delphi routine to C#?
Thanks,
Jacques
---------------
function fastlog2(val:single):single;
var
logg2,x:longint;
begin
x:=longint((@val)^);
logg2:=((x shr 23) and 255)-128;
x:=x and (not(255 shl 23));
x:=x+127 shl 23;
result:=single((@x)^)+logg2;
end;
---------------