Re: [julia-users] round(Int, typemin(Float64))

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 9:32 PM, K leo  wrote:
> julia> round(Int, typemin(Float64))
> ERROR: InexactError()
>  in round at ./float.jl:181
>
> Should this be handled this way?  Or is it better to make round(Int,
> typemin(Float64)) to be typemin(Int)?

That's not how it (rounding to the closest integer) is defined.

>
> Also, why is typemin(Float64) -Inf but typemin(Int) -9223372036854775808?
> Can typemin(Int) be made -Inf as well?

It doesn't exist as a machine Int.

>


[julia-users] round(Int, typemin(Float64))

2016-04-20 Thread K leo
julia> round(Int, typemin(Float64))
ERROR: InexactError()
 in round at ./float.jl:181

Should this be handled this way?  Or is it better to make round(Int,
typemin(Float64)) to be typemin(Int)?

Also, why is typemin(Float64) -Inf but typemin(Int) -9223372036854775808?
Can typemin(Int) be made -Inf as well?