Re: Improvements to BigDecimal(double, MathContext) constructor

2016-07-07 Thread Claes Redestad
On 2016-07-07 18:18, John Platts wrote: Here is the current significand normalization loop below in the BigDecimal(double, MathContext) constructor: // Normalize while ((significand & 1) == 0) { // i.e., significand is even significand >>= 1; exponent+

Improvements to BigDecimal(double, MathContext) constructor

2016-07-07 Thread John Platts
Here is the current significand normalization loop below in the  BigDecimal(double, MathContext) constructor:         // Normalize         while ((significand & 1) == 0) { // i.e., significand is even             significand >>= 1;             exponent++;         } Here is a better way to normaliz