Commons Math - Primes

org.apache.commons.math3.primes.Primes 是关于质数操作的工具类。

1. public static boolean isPrime(int n)
  判断 n 是否为质数。

2. public static int nextPrime(int n)
  返回大于 n 的最小质数。

3. public static List<Integer> primeFactors(int n)
  分解质因数,返回 n 的质因数。

 

More: Java Doc

 

posted on 2016-06-22 10:38  huey2672  阅读(279)  评论(0编辑  收藏  举报