java.lang.Math.abs方法
2021-01-19 17:14
标签:abs void modifier oat 函数 head static oid mod java.lang.Math.abs方法 标签:abs void modifier oat 函数 head static oid mod 原文地址:https://www.cnblogs.com/sweetorangezzz/p/12906967.htmljava.lang.Math.abs方法
Modifier and Type
方法
描述
static doubleabs(double a)返回值为
double绝对值。
static floatabs(float a)返回值为
float绝对值。
static intabs(int a)返回一个
int绝对值。
static longabs(long a)返回值为
long绝对值。abs(double a)
public class TestAbs {
public static void main(String[] args) {
test();
}
//测试 abs(double a)方法
public static void test(){
double abs = Math.abs(1.23);
System.out.println("双精度浮点数的绝对值:" + abs);
}
}
双精度浮点数的绝对值:1.23
其他函数类似
文章标题:java.lang.Math.abs方法
文章链接:http://soscw.com/index.php/essay/44154.html