in reply to Re^2: Perl6 discoveries — floating-point
in thread Perl6 discoveries — floating-point
(The perl6 developers have been recently informed of this.)C:\>perl6 -e "printf '%.16e\n', 1.7320508075688772e0;" 1.7320508075688800e+00
It is known that the way that perl6 assigns doubles can result in weird discrepancies and, given that the 2 rationals are so close together in value, I would not be surprised if that method of assigning the doubles is the culprit.C:\>perl6 -e "say Rat(0.7777777777777777777770) > Rat(0.77777777777777 +77777771);" False C:\>perl6 -e "say Num(Rat(0.7777777777777777777770)) > Num(Rat(0.77777 +77777777777777771));" True
then you avoid the "Rat to Num" conversion and get the correct result.C:\>perl6 -e "say Num(0.7777777777777777777770e0) == Num(0.77777777777 +77777777771e0);" True
C:\>perl6 -e "say 0.7777777777777777777770e0 == 0.77777777777777777777 +71e0;" True
|
|---|