mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-12-19 02:07:27 +08:00
Current implementation is buggy and hard to read. * Negative values were raising a TypeError due to `math.sqrt` * 1 was considered prime, it is not. * 2 was considered not prime, it is. The implementation has been corrected to fix the bugs and to enhance readability. A docstring has been added with the definition of a prime number. A complete test suite has been written, it tests the 10 first primes, a negative value, 0, 1 and some not prime numbers. closes #795
1.6 KiB
1.6 KiB