Skip to content

Commit

Permalink
removing unnecessary steps in nimMul64by64To128()
Browse files Browse the repository at this point in the history
  • Loading branch information
rockcavera committed Mar 21, 2024
1 parent ba55734 commit a9f23f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nint128.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.3.2"
version = "0.3.3"
author = "rockcavera"
description = "128-bit integers"
license = "MIT"
Expand Down
4 changes: 1 addition & 3 deletions src/nint128/arithmetic/multiplication.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ func nimMul64by64To128(a, b: uint64): UInt128 {.inline.} =
result.lo = tmp and 0xFFFFFFFF'u64
tmp = tmp shr 32
tmp += aHi * bLo
result.lo = ((tmp and 0xFFFFFFFF'u64) shl 32) or result.lo
result.hi = tmp shr 32
tmp = result.lo shr 32
result.lo = result.lo and 0xFFFFFFFF'u64
tmp = tmp and 0xFFFFFFFF'u64
tmp += bHi * aLo
result.lo = ((tmp and 0xFFFFFFFF'u64) shl 32) or result.lo
result.hi += tmp shr 32
Expand Down

0 comments on commit a9f23f2

Please sign in to comment.