import java.awt.image.BufferedImage;
import java.io.IOException;
import java.math.BigDecimal;
+import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
static double round10(double d) {
- return new BigDecimal(d).setScale(10, BigDecimal.ROUND_HALF_UP).doubleValue();
+ return new BigDecimal(d).setScale(10, RoundingMode.HALF_UP).doubleValue();
}
static int readRectS(LittleEndianInputStream leis, Rectangle2D bounds) {
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.math.RoundingMode;
import org.apache.poi.util.HexDump;
import org.junit.Test;
BigDecimal bd = new BigDecimal(hd.getSignificand()).divide(new BigDecimal(BigInteger.ONE.shiftLeft(gg)));
int excessPrecision = bd.precision() - 23;
if (excessPrecision > 0) {
- bd = bd.setScale(bd.scale() - excessPrecision, BigDecimal.ROUND_HALF_UP);
+ bd = bd.setScale(bd.scale() - excessPrecision, RoundingMode.HALF_UP);
}
return bd.unscaledValue().toString();
}
}
int excessPrecision = bd.precision() - nDec;
if (excessPrecision > 0) {
- bd = bd.setScale(bd.scale() - excessPrecision, BigDecimal.ROUND_HALF_UP);
+ bd = bd.setScale(bd.scale() - excessPrecision, RoundingMode.HALF_UP);
}
return bd.unscaledValue();
}