mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Fix APInt::operator*= so that it computes the correct result for large integers where there is unsigned overflow. Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases). Fixes PR11086.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141441 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3455,7 +3455,7 @@ void APFloat::toString(SmallVectorImpl<char> &Str,
|
||||
// <= semantics->precision + e * 137 / 59
|
||||
// (log_2(5) ~ 2.321928 < 2.322034 ~ 137/59)
|
||||
|
||||
unsigned precision = semantics->precision + 137 * texp / 59;
|
||||
unsigned precision = semantics->precision + (137 * texp + 136) / 59;
|
||||
|
||||
// Multiply significand by 5^e.
|
||||
// N * 5^0101 == N * 5^(1*1) * 5^(0*2) * 5^(1*4) * 5^(0*8)
|
||||
|
Reference in New Issue
Block a user