Bug of `binary_extended_gcd`
I am reading <https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2024/04/13/module/gcd.h> and found that `binary_extended_gcd` returns wrong result when giving `a=212, b=31`. Correct result is `g=1, x=6, y=-41`, but `binary_extended_gcd` returns `g=1, x=22, y=-157`, `a*x+b*y=-203` not `1`.
关闭于 2024-04-15 1 条评论