[
https://issues.apache.org/jira/browse/NUMBERS-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16806892#comment-16806892
]
Gilles commented on NUMBERS-70:
-------------------------------
{quote}
{code}
public static boolean isPrime(int n) {
if (n < 2) {
return false;
}
for (int p : SmallPrimes.PRIMES) {
if (0 == (n % p)) {
return n == p;
}
}
return SmallPrimes.millerRabinPrimeTest(n);
}
{code}
{quote}
At this level, documentation is for _users_ of the library.
The library provides a method [{{isPrime(int
n)}}|https://commons.apache.org/proper/commons-numbers/commons-numbers-primes/apidocs/org/apache/commons/numbers/primes/Primes.html#isPrime-int-]
in class {{Primes}}; hence, why show an alternative implementation?
Moreover {{SmallPrimes}} is not public.
> Userguide and reports
> ---------------------
>
> Key: NUMBERS-70
> URL: https://issues.apache.org/jira/browse/NUMBERS-70
> Project: Commons Numbers
> Issue Type: Wish
> Reporter: Gilles
> Priority: Minor
> Labels: benchmark, documentation, gsoc2019
> Fix For: 1.0
>
> Attachments: 0001-Prime-xdoc-file-is-added.patch,
> 0001-Primes-xdoc-is-added.patch
>
>
> Review contents of the component towards providing an up-to-date userguide
> and write benchmarking code for generating performance reports
> ([JMH|http://openjdk.java.net/projects/code-tools/jmh/]).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)