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

Method shl_limbs

Source/external/fast_float.h:2327–2345  ·  view source on GitHub ↗

move the limbs left by `n` limbs.

Source from the content-addressed store, hash-verified

2325
2326 // move the limbs left by `n` limbs.
2327 FASTFLOAT_CONSTEXPR20 bool shl_limbs(size_t n) noexcept {
2328 FASTFLOAT_DEBUG_ASSERT(n != 0);
2329 if (n + vec.len() > vec.capacity()) {
2330 return false;
2331 } else if (!vec.is_empty()) {
2332 // move limbs
2333 limb* dst = vec.data + n;
2334 const limb* src = vec.data;
2335 std::copy_backward(src, src + vec.len(), dst + vec.len());
2336 // fill in empty limbs
2337 limb* first = vec.data;
2338 limb* last = first + n;
2339 ::std::fill(first, last, 0);
2340 vec.set_len(n + vec.len());
2341 return true;
2342 } else {
2343 return true;
2344 }
2345 }
2346
2347 // move the limbs left by `n` bits.
2348 FASTFLOAT_CONSTEXPR20 bool shl(size_t n) noexcept {

Callers

nothing calls this directly

Calls 4

capacityMethod · 0.80
is_emptyMethod · 0.80
set_lenMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected