Math类3

作者: JAVA加油 | 来源:发表于2023-12-13 08:35 被阅读0次

最大值和最小值:

double max(double a, double b):返回 a 和 b 中较大的值。

float max(float a, float b):返回 a 和 b 中较大的值。

int max(int a, int b):返回 a 和 b 中较大的值。

long max(long a, long b):返回 a 和 b 中较大的值。

double min(double a, double b):返回 a 和 b 中较小的值。

float min(float a, float b):返回 a 和 b 中较小的值。

int min(int a, int b):返回 a 和 b 中较小的值。

long min(long a, long b):返回 a 和 b 中较小的值。

除了上述方法,Math 类还提供了一些其他的数学运算方法,例如平方根、三角函数的反函数、随机数生成等。

相关文章

网友评论

      本文标题:Math类3

      本文链接:https://www.haomeiwen.com/subject/eespgdtx.html