fixes related to Nim v1.0.2 32 bit type inference rule modification
This commit is contained in:
parent
9993b9dca4
commit
6eb7b7054e
|
@ -19,7 +19,7 @@ import macros,
|
|||
func lo(x: uint64): uint64 {.inline.} =
|
||||
const
|
||||
p: uint64 = 32
|
||||
base: uint64 = 1 shl p
|
||||
base: uint64 = 1'u64 shl p
|
||||
mask: uint64 = base - 1
|
||||
result = x and mask
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@ suite "Testing unsigned int multiplication implementation":
|
|||
|
||||
check: cast[uint64](a*b*c) == 1_000_000_000_000_000_000_000'u64 # need 70-bits
|
||||
|
||||
test "Nim v1.0.2 32 bit type inference rule changed":
|
||||
let x = 9975492817.stuint(256)
|
||||
let y = 16.stuint(256)
|
||||
check x * y == 159607885072.stuint(256)
|
||||
|
||||
suite "Testing unsigned int division and modulo implementation":
|
||||
test "Divmod(100, 13) returns the correct result":
|
||||
|
|
Loading…
Reference in New Issue