Yea that's how I figured to get around the math.pow() I was just having some trouble implementing that into the algorithm.
Type: Posts; User: firstTimeJava
Yea that's how I figured to get around the math.pow() I was just having some trouble implementing that into the algorithm.
This is my algorithm so far:
public static int getPth(int x) {
int largestP = 1;
for (int p = 1; p < x; p++) {
for (int b = 1; b < x; b++) {
...
Here is my current algorithm, the TimeExec is just a class to print out how long it takes to run the code:
public class Primes {
/**
* Get a set of prime numbers.
* @param no the...