mirror of
https://github.com/status-im/nim-stint.git
synced 2025-02-19 18:38:13 +00:00
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)
|
# Clang on MacOS does with the -d:release switch and MpUint[uint32] (uint64)
|
||||||
type SubTy = type x.lo
|
type SubTy = type x.lo
|
||||||
x.lo -= y.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.}=
|
proc `-`*(x, y: MpUintImpl): MpUintImpl {.noSideEffect, noInit, inline.}=
|
||||||
# Substraction for multi-precision unsigned int
|
# Substraction for multi-precision unsigned int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user