zig/lib/std/math/big
Frank Denis a03f9548d3 std/math/big/int: normalize after a right shift
After a right shift, top limbs may be all zero. However, without
normalization, the number of limbs is not going to change.

In order to check if a big number is zero, we used to assume that the
number of limbs is 1. Which may not be the case after right shifts,
even if the actual value is zero.

- Normalize after a right shift
- Add a test for that issue
- Check all the limbs in `eqlZero()`. It may not be necessary if
callers always remember to normalize before calling the function.
But checking all the limbs is very cheap and makes the function less
bug-prone.
2021-02-01 12:10:01 -08:00
..
int.zig std/math/big/int: normalize after a right shift 2021-02-01 12:10:01 -08:00
int_test.zig std/math/big/int: normalize after a right shift 2021-02-01 12:10:01 -08:00
rational.zig Year++ 2020-12-31 15:45:24 -08:00