For most immutable numeric types a === b
if a == b
. For example:
julia> Int128(1) === Int128(1)
true
This is not the case with BigInt and BigFloat
julia> BigInt(1) === BigInt(1)
false
julia> BigFloat(1) === BigFloat(1)
false
Comparison using ==
still works as expected, so big(1) == big(1)
, but this does not extend to comparing struct
s that contain BigInt
or BigFloat
(unless ==
is explicitly overloaded) because ==
defaults to ===
.
julia> immutable T
x::BigInt
end
julia> T(1) == T(1)
false
Is there a reason for this behavior, or it it a bug?
(I’ve tried this under 0.5.1 and 0.6.0-pre.alpha.76.)