Section Binary_Bits.
Arguments exist {A} {P}.
Arguments B754_zero {prec} {emax}.
Arguments B754_infinity {prec} {emax}.
Arguments B754_nan {prec} {emax}.
Arguments B754_finite {prec} {emax}.
(** Number of bits for the fraction and exponent *)
Variable mw ew : Z.
Definition join_bits (s : bool) m e :=
(Z.shiftl ((if s then Zpower 2 ew else 0) + e) mw + m)%Z.

Lemma join_bits_range :
forall s m e,
(0 <= m < 2^mw)%Z ->
(0 <= e < 2^ew)%Z ->
(0 <= join_bits s m e < 2 ^ (mw + ew + 1))%Z.