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
Int::Primitive#==(Float::Primitive) and Float::Primitive#==(Int::Primitive), as well as the other relational operators, all convert the integer argument to the same type as the float argument before doing the comparison. This leads to some odd results when the conversion is inexact:
Int::Primitive#==(Float::Primitive)
andFloat::Primitive#==(Int::Primitive)
, as well as the other relational operators, all convert the integer argument to the same type as the float argument before doing the comparison. This leads to some odd results when the conversion is inexact:This is problematic because
#hash
is exact:The inexact pairs of types are:
Int32
,Float32
UInt32
,Float32
Int64
,Float32 | Float64
UInt64
,Float32 | Float64
Int128
,Float32 | Float64
UInt128
,Float32 | Float64
Python handles this correctly, which they call a nightmare. Ruby handles equality here and comparisons here.
The text was updated successfully, but these errors were encountered: