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 #338

Closed
rust-highfive opened this issue Sep 28, 2014 · 6 comments
Closed

Overflow on num::rational::Ratio #338

rust-highfive opened this issue Sep 28, 2014 · 6 comments

Comments

@rust-highfive
Copy link

(moved to rust-num/num#12 )

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;
        }
@nrc
Copy link
Member

nrc commented Sep 28, 2014

Wrong repo

@nrc nrc closed this as completed Sep 28, 2014
@pnkfelix
Copy link
Member

@nick29581 shouldn't you reopen the original issue in rust repo (or o/w address root problem) before closing these?

@nrc
Copy link
Member

nrc commented Sep 29, 2014

I did, then I moved them to libnum, then I closed them again.

@pnkfelix
Copy link
Member

@nick29581 oh I see. The script was still saying RFC repo in its comment so I overlooked the fact that it now opened an issue on rust repo

@nrc
Copy link
Member

nrc commented Sep 29, 2014

AH, I forgot to change that part of the script :-( At least the link it right.

@pnkfelix
Copy link
Member

(for those who didn't follow the ping-pong discussion: the ticket has moved to: rust-num/num#12 ;) )

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

3 participants