Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
carry.hpp File Reference
#include <cstdint>
#include <type_traits>

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal

Functions

uint64_t sw::universal::addcarry (uint64_t a, uint64_t b, uint64_t carry_in, uint64_t &carry_out)
 add two uint64_t limbs with carry-in, producing a sum and carry-out
uint64_t sw::universal::subborrow (uint64_t a, uint64_t b, uint64_t borrow_in, uint64_t &borrow_out)
 subtract two uint64_t limbs with borrow-in, producing a difference and borrow-out
constexpr void sw::universal::mul128 (uint64_t a, uint64_t b, uint64_t &lo, uint64_t &hi)
 multiply two uint64_t values producing a 128-bit result as lo and hi halves; usable in constant evaluation, where MSVC's intrinsic is not (#1819)