Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 561e6a7

Browse files
committed
fix another case
1 parent f9e1459 commit 561e6a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/math/log.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,9 @@ impl DInt64 {
342342
if (self.sign ^ other.sign) != 0 {
343343
c = ai - bi;
344344
} else {
345-
c = ai.wrapping_add(bi);
346-
if c != 0 {
345+
let oflow;
346+
(c, oflow) = ai.overflowing_add(bi);
347+
if oflow {
347348
c += c & 0x1;
348349
c = (1u128 << 127) | (c >> 1);
349350
m_ex += 1;

0 commit comments

Comments
 (0)