diff options
Diffstat (limited to 'library/core/src/num/flt2dec/strategy')
-rw-r--r-- | library/core/src/num/flt2dec/strategy/dragon.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/num/flt2dec/strategy/dragon.rs b/library/core/src/num/flt2dec/strategy/dragon.rs index 8ced5971e..71b14d0ae 100644 --- a/library/core/src/num/flt2dec/strategy/dragon.rs +++ b/library/core/src/num/flt2dec/strategy/dragon.rs @@ -366,7 +366,7 @@ pub fn format_exact<'a>( if order == Ordering::Greater || (order == Ordering::Equal // SAFETY: `buf[len-1]` is initialized. - && (len == 0 || unsafe { buf[len - 1].assume_init() } & 1 == 1)) + && len > 0 && unsafe { buf[len - 1].assume_init() } & 1 == 1) { // if rounding up changes the length, the exponent should also change. // but we've been requested a fixed number of digits, so do not alter the buffer... |