16#define HPDYAD_MAX_LIMBS 32
38unsigned ctz64(
unsigned long long x);
44int msb32(
unsigned int x);
unsigned ctz64(unsigned long long x)
Count trailing zero bits in a 64-bit unsigned integer.
Definition hpdyad.c:17
void hpdyad_set_ull(hpdyad_t *a, unsigned long long x, signed char sign)
Initialize hpdyad from unsigned long long with sign.
Definition hpdyad.c:65
int msb32(unsigned int x)
Find index of most significant bit in a 32-bit unsigned integer.
Definition hpdyad.c:33
void hpdyad_mul(hpdyad_t *out, const hpdyad_t *a, const hpdyad_t *b)
Multiply two high precision dyadic numbers (hpdyad's): out = a * b.
Definition hpdyad.c:162
void hpdyad_add(hpdyad_t *out, const hpdyad_t *a, const hpdyad_t *b)
Add two high precision dyadic numbers (hpdyad's): out = a + b.
Definition hpdyad.c:512
#define HPDYAD_MAX_LIMBS
Maximum number of 32-bit limbs in fixed-size representation (1024 bits total).
Definition hpdyad.h:16
double hpdyad_to_double(const hpdyad_t *a)
Convert hpdyad to double with round-to-nearest-even.
Definition hpdyad.c:614
void hpdyad_normalize(hpdyad_t *a)
Normalize hpdyad: trim leading zeros and left-shift mantissa so MSB of top limb is 1.
Definition hpdyad.c:94
void hpdyad_shr_bits_sticky(hpdyad_t *dst, const hpdyad_t *src, unsigned int bits)
Right-shift mantissa with sticky bit (value-preserving)
Definition hpdyad.c:240
void hpdyad_shl_bits(hpdyad_t *dst, const hpdyad_t *src, int bits)
Left-shift mantissa by specified number of bits (value-preserving)
Definition hpdyad.c:446
Fixed-size high-precision dyadic number (hpdyad) with separate sign and binary exponent.
Definition hpdyad.h:28