Hi,
the function math.samevalue does not seem to work for small numbers:
See FPC-2.2.4 unit math lines 2177, 2155, 2195:
function SameValue(const A, B: Double; Epsilon: Double): Boolean;
begin
if (Epsilon=0) then
Epsilon:=Max(Min(Abs(A),Abs(B))*DZeroResolution,DZeroResolution);
if (A>B) then
Result:=((A-B)<=Epsilon)
else
Result:=((B-A)<=Epsilon);
end;
For example 1e-40 and 2e-40 will return TRUE!
One possible fix would be:
>>>> Epsilon:=Max(Abs(A),Abs(B))*DZeroResolution;
Also the constants DZeroResolution and EZeroResolution seem to be larger
than necessary.
Thank you
Alain
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel