Files
javaSE251223/day08/src/com/inmind/math04/Demo15.java
2026-01-05 10:40:37 +08:00

17 lines
591 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.inmind.math04;
/*
计算在 -10.8 到5.9 之间绝对值大于6 或者小于2.1 的整数有多少个?
分析:
取值范围: -10.8 ~5.9
条件>6||<2.1
定义一个变量来计数
Math工具类的使用
public static double abs(double a) :返回 double 值的绝对值。
public static double ceil(double a) :返回大于等于参数的最小的整数。
public static double floor(double a) :返回小于等于参数最大的整数。
public static long round(double a) :返回最接近参数的 long。(相当于四舍五入方法)
*/
public class Demo15 {
}