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

Closed
klutzy opened this issue Aug 27, 2014 · 2 comments
Closed

Overflow on num::rational::Ratio #16782

klutzy opened this issue Aug 27, 2014 · 2 comments

Comments

@klutzy
Copy link
Contributor

klutzy commented Aug 27, 2014

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;
        }
@rust-highfive
Copy link
Collaborator

This issue has been moved to the RFCs repo: rust-lang/rfcs#338

@rust-highfive
Copy link
Collaborator

This issue has been moved to the RFCs repo: rust-num/num#12

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Mar 10, 2024
…nts, r=Veykril

fix: Preserve $ and \ in postfix format completions

`parse_format_exprs` doesn't escape these two as of rust-lang#16781, so they have to be escaped as a separate step.
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