Skip to content

Commit ddc2a86

Browse files
committed
simplify scale2
1 parent d99a963 commit ddc2a86

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/java.base/share/classes/java/math/BigDecimal.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4334,10 +4334,9 @@ private String layoutCharsE(boolean sci, String coeff, int coeffLen, long adjust
43344334

43354335
private static String scale2(int intCompact) {
43364336
int highInt = intCompact / 100;
4337-
int lowInt = intCompact - highInt * 100;
43384337
int highIntSize = DecimalDigits.stringSize(highInt);
43394338
byte[] buf = new byte[highIntSize + 3];
4340-
DecimalDigits.putPairLatin1(buf, highIntSize + 1, lowInt);
4339+
DecimalDigits.putPairLatin1(buf, highIntSize + 1, intCompact - highInt * 100);
43414340
buf[highIntSize] = '.';
43424341
DecimalDigits.getCharsLatin1(highInt, highIntSize, buf);
43434342
return newStringNoRepl(buf);

0 commit comments

Comments
 (0)