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

Inconsistent results for cast::i64(-0.1f64) and cast::u64(-0.1f64) #16

Closed
ollie27 opened this issue May 7, 2017 · 0 comments
Closed

Comments

@ollie27
Copy link

ollie27 commented May 7, 2017

Using 0.2.1 cast::i64(-0.1f64) returns Ok(0) but cast::u64(-0.1f64) returns Err(Underflow). I would expect the latter to also return Ok(0) as float to int conversions truncate towards 0 and 0 can be represented in a u64 just fine.

@bors bors bot closed this as completed in 856b833 Nov 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant