sbb static method

(Uint64, Uint64) sbb(
  1. Uint64 a,
  2. Uint64 b,
  3. Uint64 borrowIn
)

Implementation

static (Uint64, Uint64) sbb(Uint64 a, Uint64 b, Uint64 borrowIn) {
  final bit = _nonzeroBit(borrowIn);
  final s1 = a - b;
  final bw1 = _borrow(a, b, s1);
  final s2 = s1 - bit;
  final bw2 = _borrow(s1, bit, s2);
  // bw1 and bw2 can never both be 1, so | is the same as +.
  final mask = Uint64.zero - (bw1 | bw2);
  return (s2, mask);
}