def u64_wsub

bend-collections-laws-math@1.0.0.0 · src/math/fixed.bend:301

import bend-collections-laws-math@1.0.0.0/src/math/fixed.bend as Fixed
import Base
import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as W
import bend-collections-laws-math@1.0.0.0/src/math/w64.bend as X

301# a - b modulo 2^64 for any a, b: a + (2^64 - 1 - b) + 1
302def u64_wsub(+a: W.U64, +b: W.U64) -> W.U64:
303  X.add(X.add(a, X.sub(u64_max(), b)), W.U64{1, 0})

Uses (4)

Used by (3)