Check Prime numbers

This commit is contained in:
2021-09-23 15:49:02 -04:00
parent f3702780af
commit 17044eb132
4 changed files with 88 additions and 6 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
- [Java 中的 NaN](https://www.ossez.com/t/java-nan/13748)
- [Generating Prime Numbers in Java](https://www.baeldung.com/java-generate-prime-numbers)
- [Using Math.pow in Java](https://www.baeldung.com/java-math-pow)
- [Check If a Number Is Prime in Java](https://www.baeldung.com/java-prime-numbers)
- [如何用 Java 判断一个给定的数是不是素数](https://www.ossez.com/t/java/13749)
- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers)
- [Finding the Least Common Multiple in Java](https://www.baeldung.com/java-least-common-multiple)
- [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers)
@@ -1,7 +1,9 @@
package com.ossez.prime;
import org.apache.commons.math3.primes.Primes;
import org.junit.Test;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
@@ -25,5 +27,6 @@ public class PrimeGeneratorUnitTest {
public void whenSieveOfEratosthenes_returnsSuccessfully() {
final List<Integer> primeNumbers = sieveOfEratosthenes(20);
assertEquals(Arrays.asList(new Integer[] { 2, 3, 5, 7, 11, 13, 17, 19 }), primeNumbers);
BigInteger bigInt = BigInteger.valueOf(100);
}
}