type Bits … func (x Bits) add(y Bits) Bits { … } func (x Bits) mul(y Bits) Bits { … } func TestMulBits(t *testing.T) { … } // norm returns the normalized bits for x: It removes multiple equal entries // by treating them as an addition (e.g., Bits{5, 5} => Bits{6}), and it sorts // the result list for reproducible results. func (x Bits) norm() Bits { … } func TestNormBits(t *testing.T) { … } // round returns the Float value corresponding to x after rounding x // to prec bits according to mode. func (x Bits) round(prec uint, mode RoundingMode) *Float { … } // Float returns the *Float z of the smallest possible precision such that // z = sum(2**bits[i]), with i = range bits. If multiple bits[i] are equal, // they are added: Bits{0, 1, 0}.Float() == 2**0 + 2**1 + 2**0 = 4. func (bits Bits) Float() *Float { … } func TestFromBits(t *testing.T) { … }