![JAR search and dependency download from the Maven repository](/logo.png)
spoon.examples.distcalc.src.Primary Maven / Gradle / Ivy
The newest version!
package spoon.examples.distcalc.src;
import spoon.examples.distcalc.annotation.Node;
public abstract class Primary implements Services {
@SuppressWarnings("unused")
@Node
boolean primary123(long n) {
pre: if (n <= 3)
;
fun: primary(n);
return true;
}
@SuppressWarnings("unused")
@Node
boolean primaryN(long n) {
pre: if (n > 3)
;
fun: primary(n);
for (long i = 2; i < n; i++) {
if (primary(i)) {
if (((double) n / (double) i) == n / i)
return false;
}
}
return true;
}
// @Node
// boolean primary1(long n) {
// fun: primary(n);
// return true;
// }
//
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy