One example is that
julia> x-1+1 == x
true
works in some cases where
julia> Int64(Float64(x)-1)+1 == x
does not, such as x = typemax(Int64)
.
julia> Int64(Float64(x)-1)+1 == x
ERROR: InexactError: Int64(9.223372036854776e18)
One example is that
julia> x-1+1 == x
true
works in some cases where
julia> Int64(Float64(x)-1)+1 == x
does not, such as x = typemax(Int64)
.
julia> Int64(Float64(x)-1)+1 == x
ERROR: InexactError: Int64(9.223372036854776e18)