public class MathUtils
extends java.lang.Object
| 构造器和说明 |
|---|
MathUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.util.List<java.lang.Integer> |
findPrimes(int count)
从2开始寻找指定数量的质数
|
static boolean |
isOdd(int value)
判断奇数
|
static boolean |
isPrime(int number)
判断是否是质数
|
static int |
powIntegral(int radix,
int power)
计算 radix的power次幂(power>=0)
|
static long |
powIntegral(long radix,
long power)
计算 radix的power次幂(power>=0)
|
static long |
powIntegralL(int radix,
int power)
计算 radix的power次幂(power>=0)
|
static double |
toFixed(double value,
int scale)
四舍五入保留指定位数的小数
|
static double |
toFixed(double value,
int scale,
java.math.RoundingMode roundingMode)
保留指定位数的小数
|
static double |
toFixed(long value,
int scale)
四舍五入保留指定位数的小数
|
static double |
toFixed(long value,
int scale,
java.math.RoundingMode roundingMode)
保留指定位数的小数
|
static java.lang.String |
toFixedString(double value,
int scale)
四舍五入保留指定位数的小数
|
static java.lang.String |
toFixedString(double value,
int scale,
java.math.RoundingMode roundingMode)
保留指定位数的小数
|
static java.lang.String |
toFixedString(long value,
int scale)
四舍五入保留指定位数的小数
|
static java.lang.String |
toFixedString(long value,
int scale,
java.math.RoundingMode roundingMode)
保留指定位数的小数
|
public static double toFixed(double value,
int scale)
value - scale - public static double toFixed(double value,
int scale,
java.math.RoundingMode roundingMode)
value - scale - roundingMode - 舍入算法public static double toFixed(long value,
int scale)
value - scale - public static double toFixed(long value,
int scale,
java.math.RoundingMode roundingMode)
value - scale - roundingMode - 舍入算法public static java.lang.String toFixedString(double value,
int scale)
value - scale - public static java.lang.String toFixedString(double value,
int scale,
java.math.RoundingMode roundingMode)
value - scale - roundingMode - 舍入算法public static java.lang.String toFixedString(long value,
int scale)
value - scale - public static java.lang.String toFixedString(long value,
int scale,
java.math.RoundingMode roundingMode)
value - scale - roundingMode - 舍入算法public static boolean isOdd(int value)
value - public static long powIntegral(long radix,
long power)
radix - power - public static int powIntegral(int radix,
int power)
radix - power - public static long powIntegralL(int radix,
int power)
radix - power - public static java.util.List<java.lang.Integer> findPrimes(int count)
count - public static boolean isPrime(int number)
number -