2018-03-03 15:44:21 +00:00
|
|
|
import ttmath, unittest
|
|
|
|
|
|
|
|
suite "ttmath":
|
|
|
|
test "Ints":
|
|
|
|
let a = i256"12345678910111213141516"
|
|
|
|
let b = i256"16151413121110987654321"
|
2018-03-20 19:15:55 +00:00
|
|
|
check sizeof(a) == 32
|
2018-03-03 15:44:21 +00:00
|
|
|
check $(a + b) == "28497092031222200795837"
|
|
|
|
|
|
|
|
test "UInts":
|
|
|
|
let a = u256"12345678910111213141516"
|
|
|
|
let b = u256"16151413121110987654321"
|
2018-03-20 19:15:55 +00:00
|
|
|
check sizeof(a) == 32
|
2018-03-03 15:44:21 +00:00
|
|
|
check $(a + b) == "28497092031222200795837"
|