From 1aa27963d24dc43e35c5cd6232b07afb97776384 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 4 Dec 2014 19:48:32 -0800 Subject: [PATCH] math.primes.miller-rabin: actually, this is better. --- basis/math/primes/miller-rabin/miller-rabin.factor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/basis/math/primes/miller-rabin/miller-rabin.factor b/basis/math/primes/miller-rabin/miller-rabin.factor index 1638f31ec1..f46af20249 100644 --- a/basis/math/primes/miller-rabin/miller-rabin.factor +++ b/basis/math/primes/miller-rabin/miller-rabin.factor @@ -7,7 +7,8 @@ IN: math.primes.miller-rabin ( r s ) + n 1 - :> n-1 + n-1 factor-2s :> ( r s ) 0 :> a! trials iota [ drop @@ -16,7 +17,7 @@ IN: math.primes.miller-rabin f ] [ r iota [ - 2^ s * a swap n ^mod n - -1 = + 2^ s * a swap n ^mod n-1 = ] any? not ] if ] any? not ;