Crystal: Regression in `BigDecimal#to_big_i`

Created on 12 Feb 2020  路  8Comments  路  Source: crystal-lang/crystal

Regression introduced in Crystal 0.31.0 (#8120)

require "big"

"-100.000".to_big_d.to_big_i # => -100000

Before: https://carc.in/#/r/8jrq
After: https://carc.in/#/r/8jro

/cc @bcardiff

bug topicnumeric

Most helpful comment

Other broken case: "-1.1".to_big_d.to_big_i # => -10. #8790 doesn't fix this.

All 8 comments

Other broken case: "-1.1".to_big_d.to_big_i # => -10. #8790 doesn't fix this.

@straight-shoota Force-pushed amended commit with the fix.

I scheduled the PR for 0.34.0. It could not review it yet.

Would've been nice to include it in 0.33.0 since it's already fixed. But I guess it's fine.

@bcardiff It's been reviewed already and there are tests, so why hold it back...? :/

@straight-shoota Thanks for merging! I guess it should have the 0.34.0 milestone added too.

Usually only PRs are milestoned (see previous ones) to keep the noise down. Both PR and issue relate to the same bug or feature and we only need to have one representation in the milestone.

@straight-shoota Good to know, makes sense! I got mistaken by this:

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oprypin picture oprypin  路  3Comments

RX14 picture RX14  路  3Comments

Papierkorb picture Papierkorb  路  3Comments

jhass picture jhass  路  3Comments

relonger picture relonger  路  3Comments