Fix borrow border case: see https://github.com/status-im/mpint/issues/10
This commit is contained in:
parent
6c21b54a87
commit
55dd38c67c
|
@ -36,7 +36,7 @@ proc `-=`*(x: var MpUintImpl, y: MpUintImpl) {.noSideEffect, inline.}=
|
|||
# Clang on MacOS does with the -d:release switch and MpUint[uint32] (uint64)
|
||||
type SubTy = type x.lo
|
||||
x.lo -= y.lo
|
||||
x.hi -= (x.lo < not y.lo).toSubtype(SubTy) + y.hi
|
||||
x.hi -= (x.lo <= not y.lo).toSubtype(SubTy) + y.hi
|
||||
|
||||
proc `-`*(x, y: MpUintImpl): MpUintImpl {.noSideEffect, noInit, inline.}=
|
||||
# Substraction for multi-precision unsigned int
|
||||
|
|
Loading…
Reference in New Issue