diff --git a/cmd/shor/main.go b/cmd/shor/main.go index ee6d2ed..c1a501f 100644 --- a/cmd/shor/main.go +++ b/cmd/shor/main.go @@ -26,11 +26,6 @@ func main() { return } - if number.IsPrime(N) { - fmt.Printf("N=%d is prime.\n", N) - return - } - if number.IsEven(N) { fmt.Printf("N=%d is even. p=%d, q=%d.\n", N, 2, N/2) return @@ -41,6 +36,11 @@ func main() { return } + if number.IsPrime(N) { + fmt.Printf("N=%d is prime.\n", N) + return + } + if a < 0 { a = rand.Coprime(N) }