Closed
Description
julia> convert(UInt32, 4.2949673f9)
0xffffffff
4.2949673f9
is one greater than the maximum value of a UInt32
(4.2949673f9 == typemax(UInt32)+1
) so an inexact error should be thrown here:
function (::Type{$Ti})(x::$Tf)
if ($(Tf(typemin(Ti))) <= x <= $(Tf(typemax(Ti)))) && isinteger(x)
return unsafe_trunc($Ti,x)
else
throw(InexactError($(Expr(:quote,Ti.name.name)), $Ti, x))
end
end
However, the comparison that happens is 4.2949673f9 <= Float32(typemax(UInt32))
which is true even though 4.2949673f9 > typemax(UInt32)
.