< prev index next >

## src/java.base/share/classes/java/util/Formatter.java

```*** 1,7 ****
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
--- 1,7 ----
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
*** 3438,3459 ****
} else {
assert(prec >= 1 && prec <= 12);

int exponent  = Math.getExponent(d);
boolean subnormal
!                     = (exponent == DoubleConsts.MIN_EXPONENT - 1);

// If this is subnormal input so normalize (could be faster to
// do as integer operation).
if (subnormal) {
scaleUp = Math.scalb(1.0, 54);
d *= scaleUp;
// Calculate the exponent.  This is not just exponent + 54
// since the former is not the normalized exponent.
exponent = Math.getExponent(d);
!                     assert exponent >= DoubleConsts.MIN_EXPONENT &&
!                         exponent <= DoubleConsts.MAX_EXPONENT: exponent;
}

int precision = 1 + prec*4;
int shiftDistance
=  DoubleConsts.SIGNIFICAND_WIDTH - precision;
--- 3438,3459 ----
} else {
assert(prec >= 1 && prec <= 12);

int exponent  = Math.getExponent(d);
boolean subnormal
!                     = (exponent == Double.MIN_EXPONENT - 1);

// If this is subnormal input so normalize (could be faster to
// do as integer operation).
if (subnormal) {
scaleUp = Math.scalb(1.0, 54);
d *= scaleUp;
// Calculate the exponent.  This is not just exponent + 54
// since the former is not the normalized exponent.
exponent = Math.getExponent(d);
!                     assert exponent >= Double.MIN_EXPONENT &&
!                         exponent <= Double.MAX_EXPONENT: exponent;
}

int precision = 1 + prec*4;
int shiftDistance
=  DoubleConsts.SIGNIFICAND_WIDTH - precision;
```
< prev index next >