Anonymous user
Miller–Rabin primality test: Difference between revisions
→{{header|Erlang}}
Line 917:
-export([is_prime/1, power/2]).
% Replaced floating point functions with
% and added an integer power function.
% Increased number of probabilistic trials from 20 to 100
% and augmented number of deterministic proving bases.
% Dogwood, January
is_prime(1) -> false;
Line 998 ⟶ 999:
power(
power(X, N, 1).▼
N /= 0 -> power(X, N - 1, X * Acc);▼
%%%%%%% HAVE UNINTENTIONALLY MERGED FORTRAN PAGE AND UNABE TO REPAIR %%%%%%%%
</pre>
|