This commit is contained in:
Jacek Sieka 2023-05-24 17:42:58 +02:00
parent 403b5de2a7
commit 1e2fbe1c87
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,8 @@ template testMulWiden[T: SomeUnsignedInt]() =
doAssert mulWiden(T(2), T(2)) == (T(4), T(0)) doAssert mulWiden(T(2), T(2)) == (T(4), T(0))
doAssert mulWiden(T.high, T(1)) == (T.high, T(0)) doAssert mulWiden(T.high, T(1)) == (T.high, T(0))
doAssert mulWiden(T(1), T.high) == (T.high, T(0)) doAssert mulWiden(T(1), T.high) == (T.high, T(0))
echo mulWiden(T.high, T.high)
echo T.high
doAssert mulWiden(T.high, T.high) == (T(1), T.high - 1) doAssert mulWiden(T.high, T.high) == (T(1), T.high - 1)
doAssert mulWiden(T.high, T.high, T(0)) == (T(1), T.high - 1) doAssert mulWiden(T.high, T.high, T(0)) == (T(1), T.high - 1)