import java.text.ChoiceFormat;
public class Main {
public static void main(String[] argv) throws Exception {
/**来自
NowJava.com - 时 代 Java**/
double d = 1.2;
// Get the largest double less than d
double d1 = ChoiceFormat.previousDouble(d); // 1.1999999999999997
System.out.println(d1);
// Get the smallest double greater than d
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。