Fix is_negative / is_positive misclassify#402
Conversation
8d811e1 to
171b558
Compare
|
HEAD_OFFSET is never 1. For that to happen, HEAD must be 0. I guess you thought that might happen when N_BITS is divisible by LIMB_SIZE, but in that case, HEAD is just the most significant limb, having LIMB_SIZE bits. |
Agreed, under this repo’s current invariants, HEAD_OFFSET can’t be 1. That said, the is_positive / is_negative helpers are easy to reuse out of context. Once someone reuses the code and slightly tweaks the library, as has happened in several other forks, since BitVM has become the largest open Bitcoin script collection, a case with HEAD_OFFSET == 1 can realistically occur. |
Fix #401