Python/maths
Julien Castiaux 36828b106f [FIX] maths/PrimeCheck (#796)
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
2019-05-11 19:20:25 +08:00
..
3n+1.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
abs.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
absMax.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
absMin.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
average.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
basic_maths.py snake_case all the things 2018-10-19 17:14:25 -05:00
BinaryExponentiation.py add-binary-exponentiation (#790) 2019-05-10 19:03:05 +08:00
extended_euclidean_algorithm.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
factorial_python.py Organize graph algorithms (#719) 2019-02-25 17:35:24 +08:00
factorial_recursive.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
fibonacci_sequence_recursion.py Added b16, b32, a85, abs, absMax, absMin 2018-11-03 12:08:13 -08:00
find_lcm.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
FindMax.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
FindMin.py Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763) 2019-04-22 22:53:56 +08:00
greater_common_divisor.py snake_case all the things 2018-10-19 17:14:25 -05:00
Hanoi.py implementation of tower_of_hanoi algorithm (#756) 2019-04-14 19:58:16 +08:00
modular_exponential.py snake_case all the things 2018-10-19 17:14:25 -05:00
newton_raphson.py Implementation of Newton-Raphson method (#650) 2019-02-12 00:15:49 +08:00
PrimeCheck.py [FIX] maths/PrimeCheck (#796) 2019-05-11 19:20:25 +08:00
segmented_sieve.py snake_case all the things 2018-10-19 17:14:25 -05:00
sieve_of_eratosthenes.py all valid python 3 2018-10-20 14:45:08 -05:00
simpson_rule.py snake_case all the things 2018-10-19 17:14:25 -05:00
trapezoidal_rule.py snake_case all the things 2018-10-19 17:14:25 -05:00