Fix mod-inv

release
Slava Pestov 2007-10-06 17:09:15 -04:00
parent 8e985d6c6f
commit d86d83fdbb
2 changed files with 3 additions and 1 deletions

View File

@ -72,3 +72,5 @@ IN: temporary
[ 3 ] [ 5 7 mod-inv ] unit-test
[ 78572682077 ] [ 234829342 342389423843 mod-inv ] unit-test
[ 2 10 mod-inv ] unit-test-fails

View File

@ -50,7 +50,7 @@ M: integer (^)
tuck gcd 1 = [
dup 0 < [ + ] [ nip ] if
] [
[ "Non-trivial divisor found" throw ] unless
"Non-trivial divisor found" throw
] if ; foldable
: ^mod ( x y n -- z )