Miller–Rabin primality test: Difference between revisions
Content added Content deleted
Line 917: | Line 917: | ||
-export([is_prime/1, power/2]). |
-export([is_prime/1, power/2]). |
||
% Replaced floating point functions with |
% Replaced floating point functions with integer functions and arithmetic, |
||
% and added an integer power function. |
|||
% Increased number of trials from 20 to 100 |
% Increased number of probabilistic trials from 20 to 100, |
||
% Tested. |
|||
% and augmented number of deterministic proving bases. |
|||
% Dogwood, January |
% Dogwood, January 18, 2014 @ 10:52am PST. |
||
is_prime(1) -> false; |
is_prime(1) -> false; |
||
Line 998: | Line 999: | ||
power( |
power(B, E) -> power(B, E, 1). |
||
⚫ | |||
power(X, N, Acc) -> |
|||
if |
|||
⚫ | |||
true -> Acc |
|||
end. |
|||
----------------------------------------------------------------------------------------------------------------------------- |
|||
⚫ | |||
⚫ | |||
%%%%%%% HAVE UNINTENTIONALLY MERGED FORTRAN PAGE AND UNABE TO REPAIR %%%%%%%% |
|||
</pre> |
</pre> |
||