Код: Выделить всё
Double dbl = 254.9999999999999;
Integer integ = dbl.intValue();
System.out.println(integ);
Код: Выделить всё
Double dbl = 254.99999999999999;
Integer integ = dbl.intValue();
System.out.println(integ);
Почему?
Подробнее здесь: https://stackoverflow.com/questions/216 ... iciently-l
Мобильная версия