MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / small_add_from

Function small_add_from

Source/external/fast_float.h:2074–2088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2072// used in grade school multiplication
2073template <uint16_t size>
2074inline FASTFLOAT_CONSTEXPR20
2075bool small_add_from(stackvec<size>& vec, limb y, size_t start) noexcept {
2076 size_t index = start;
2077 limb carry = y;
2078 bool overflow;
2079 while (carry != 0 && index < vec.len()) {
2080 vec[index] = scalar_add(vec[index], carry, overflow);
2081 carry = limb(overflow);
2082 index += 1;
2083 }
2084 if (carry != 0) {
2085 FASTFLOAT_TRY(vec.try_push(carry));
2086 }
2087 return true;
2088}
2089
2090// add scalar value to bigint.
2091template <uint16_t size>

Callers 2

small_addFunction · 0.85
large_add_fromFunction · 0.85

Calls 3

scalar_addFunction · 0.85
try_pushMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected