Commit 6290d5a
committed
Fix IBig >> by >= bit length on DoubleWord magnitudes
are_dword_low_bits_nonzero capped its bit window at WORD_BITS instead
of DWORD_BITS, so any query asking about bits in the upper word lost
them. The arithmetic-shift path for negative values then dropped the
floor-rounding correction term, returning 0 instead of -1.
Concrete failure: IBig::from(i128::MIN) >> 128 returned 0.1 parent d73e30d commit 6290d5a
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
501 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
502 | 507 | | |
503 | 508 | | |
504 | 509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
| |||
0 commit comments