File tree 2 files changed +5
-7
lines changed
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 8
8
# if it's not a prime, the chance of it returning true is at most 1/4**prec
9
9
def is_prime_big (n , prec = 1000 ):
10
10
"""
11
- >>> from maths.prime_check import prime_check
12
- >>> # all(is_prime_big(i) == prime_check (i) for i in range(1000)) # 3.45s
13
- >>> all(is_prime_big(i) == prime_check (i) for i in range(256))
11
+ >>> from maths.prime_check import is_prime
12
+ >>> # all(is_prime_big(i) == is_prime (i) for i in range(1000)) # 3.45s
13
+ >>> all(is_prime_big(i) == is_prime (i) for i in range(256))
14
14
True
15
15
"""
16
16
if n < 2 :
Original file line number Diff line number Diff line change @@ -62,10 +62,8 @@ def test_primes(self):
62
62
self .assertTrue (is_prime (29 ))
63
63
64
64
def test_not_primes (self ):
65
- self .assertFalse (
66
- is_prime (- 19 ),
67
- "Negative numbers are excluded by definition of prime numbers." ,
68
- )
65
+ with self .assertRaises (AssertionError ):
66
+ is_prime (- 19 )
69
67
self .assertFalse (
70
68
is_prime (0 ),
71
69
"Zero doesn't have any positive factors, primes must have exactly two." ,
You can’t perform that action at this time.
0 commit comments