Module rustc_apfloat::ieee::sig
source · Expand description
Implementation details of IeeeFloat significands, such as big integer arithmetic. As a rule of thumb, no functions in this module should dynamically allocate.
Functions
- add 🔒
a += b + cwherecis zero or one. Returns the carry flag. a += bora -= b. Does not preserveb.- Clear the given bit.
- cmp 🔒Comparison (unsigned) of two significands.
- Decrement in-place, return the borrow flag.
- div 🔒
quotient = dividend / divisor. Returns the lost fraction. Does not preservedividendordivisor. - For every consecutive chunk of
bitsbits fromlimbs, going from most significant to the least significant bits, callfto transform those bits and store the result back. - extract 🔒Copies the bit vector of width
src_bitsfromsrc, starting at bit SRC_LSB, todst, such that the bit SRC_LSB becomes the least significant bit ofdst. All high bits abovesrc_bitsindstare zero-filled. - We want the most significant PRECISION bits of
src. There may not be that many; extract what we can. - get_bit 🔒Extracts the given bit.
- Increment in-place, return the carry flag.
- mul 🔒
dst = a * b(for normalaandb). Returns the lost fraction. - olsb 🔒One, not zero, based LSB. That is, returns 0 for a zeroed significand.
- omsb 🔒One, not zero, based MSB. That is, returns 0 for a zeroed significand.
- set_bit 🔒Sets the given bit.
- Shifts
dstleftbitsbits, subtractbitsfrom its exponent. - Shifts
dstrightbitsbits noting lost fraction. - sub 🔒
a -= b + cwherecis zero or one. Returns the borrow flag. [low, high] = a * b.