fn fixedIntFromSignedDoubleLimb(A: SignedDoubleLimb, storage: []Limb) Mutable A: SignedDoubleLimbstorage: []Limb4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602fn fixedIntFromSignedDoubleLimb(A: SignedDoubleLimb, storage: []Limb) Mutable {
assert(storage.len >= 2);
const A_is_positive = A >= 0;
const Au = @as(DoubleLimb, @intCast(if (A < 0) -A else A));
storage[0] = @as(Limb, @truncate(Au));
storage[1] = @as(Limb, @truncate(Au >> limb_bits));
return .{
.limbs = storage[0..2],
.positive = A_is_positive,
.len = 2,
};
}
Storage must live for the lifetime of the returned value