Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silent overflow when converting float64 to int32 #2343

Closed
mschauer opened this issue Feb 17, 2013 · 2 comments
Closed

silent overflow when converting float64 to int32 #2343

mschauer opened this issue Feb 17, 2013 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@mschauer
Copy link
Contributor

i get a silent overflow when converting float64 to int32
julia> convert(Int32, 2.0^32-1)
-1

@pao
Copy link
Member

pao commented Feb 17, 2013

Related to #855. The intrinsics exist to make this an optionally checked operation, but I don't think they're hooked up to anything yet.

@JeffBezanson
Copy link
Member

As of now, Float{32,64}->Int64 and Float32->Int32 are properly checked, but Float64->Int32 is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants