|
|
|
|
|
by fm77
1158 days ago
|
|
In Turbo Pascal :-) you have to filter for NaN or else you will end up with a Runtime Error. const NaN = $FF shl 23;
var x, t: longint;
f: single absolute x;
begin
t := 0;
x := 0;
repeat
inc(t, ord((x and NaN <> NaN) and (0<=f) and (f<=1)));
inc(x);
until x = 0;
WriteLn('total: ', t);
end.
total: 1065353218 (in ca. 40 seconds) |
|