Deprecate Integer and isPseudoprime()

This commit is contained in:
Eugen Wissner 2019-09-03 09:13:29 +02:00
parent c69282a8df
commit 048939410c
2 changed files with 2 additions and 9 deletions

View File

@ -12,6 +12,7 @@
* Source: $(LINK2 https://github.com/caraus-ecms/tanya/blob/master/source/tanya/math/mp.d, * Source: $(LINK2 https://github.com/caraus-ecms/tanya/blob/master/source/tanya/math/mp.d,
* tanya/math/mp.d) * tanya/math/mp.d)
*/ */
deprecated
module tanya.math.mp; module tanya.math.mp;
import tanya.algorithm.comparison; import tanya.algorithm.comparison;

View File

@ -663,15 +663,7 @@ in (z.length > 0, "Division by zero")
assert(pow(Integer(0), Integer(5), Integer(5)) == 0); assert(pow(Integer(0), Integer(5), Integer(5)) == 0);
} }
/** deprecated
* Checks if $(D_PARAM x) is a prime.
*
* Params:
* x = The number should be checked.
*
* Returns: $(D_KEYWORD true) if $(D_PARAM x) is a prime number,
* $(D_KEYWORD false) otherwise.
*/
bool isPseudoprime(ulong x) @nogc nothrow pure @safe bool isPseudoprime(ulong x) @nogc nothrow pure @safe
{ {
return pow(2, x - 1, x) == 1; return pow(2, x - 1, x) == 1;