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

subtract overflow on fmt::Display on BigDecimal #94

Open
austinabell opened this issue Oct 11, 2022 · 0 comments
Open

subtract overflow on fmt::Display on BigDecimal #94

austinabell opened this issue Oct 11, 2022 · 0 comments

Comments

@austinabell
Copy link

when trying to print a decimal with a very large negative scale and abs value of the integer length overflow usize::MAX, the print will panic.

Repro:

    let a = BigDecimal::new(bigdecimal::num_bigint::BigInt::from(1), i64::MIN);
    println!("{:?}", a);

The line I'm inferring is the issue here is

let location = abs_int.len() as i64 - self.scale;
(could be wrong, didn't verify)

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