The Bits class in boltons/mathutils.py has an off-by-one error in its init method when validating that a…
The Bits class in boltons/mathutils.py has an off-by-one error in its init method when validating that a…: a task in repo2rlenv-swe-gen (Harbor dataset). Currently, the guard condition uses val 2 len to check if the value is too large. However, the maximum value representable in len bits is 2 len…
The task
Currently, the guard condition uses `val > 2 ** len_` to check if the value is too large. However, the maximum value representable in `len_` bits is `2 ** len_ - 1`, which means `2 ** len_` itself cannot be represented in `len_` bits. The check should use `>=` instead of `>`, so that `val >= 2 ** len_` raises a…
Part of FineEnvs/repo2rlenv-swe-gen.