Merge pull request #11 from status-im/Fix-uint-pow

Fix uint Pow
This commit is contained in:
Yuriy Glukhov 2018-04-03 17:18:52 +03:00 committed by GitHub
commit 5adb562c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,7 @@ proc pow*(a: Int, b: int): Int =
tmp.inplacePow(initInt[Int](b))
result = tmp
proc pow*(a: UInt, b: int): UInt =
proc pow*(a: UInt, b: uint): UInt =
var tmp = a
tmp.inplacePow(initUInt[UInt](b))
result = tmp

View File

@ -21,6 +21,7 @@ suite "ttmath":
a + b == "28497092031222200795837".u256
a + b != "28497092031222200795838".u256
a + b < "28497092031222200795838".u256
pow(2.u256, 3) == 8.u256
suite "Testing conversion functions: Hex, Bytes, Endianness":
let