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

Overflow on num::rational::Ratio #12

Closed
rust-highfive opened this issue Sep 28, 2014 · 1 comment
Closed

Overflow on num::rational::Ratio #12

rust-highfive opened this issue Sep 28, 2014 · 1 comment

Comments

@rust-highfive
Copy link

Issue by klutzy
Wednesday Aug 27, 2014 at 07:50 GMT

For earlier discussion, see rust-lang/rust#16782

This issue was labelled with: in the Rust repository


use std::i64::MIN;
use:num::rational::Ratio;

let a = Ratio::new(1, MIN);

Here a actually is -1 / MIN due to overflow in reduce():

        // keep denom positive!
        if self.denom < Zero::zero() {
            self.numer = -self.numer;
            self.denom = -self.denom;
        }
remexre pushed a commit to remexre/num that referenced this issue Jun 1, 2017
fix(dependencies): Opt-out of default features of `num`
@cuviper
Copy link
Member

cuviper commented Dec 19, 2017

This issue was moved to rust-num/num-rational#6

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

2 participants