Section Fcalc_div.
Variable beta : radix.
Notation bpow e := (bpow beta e).
Variable fexp : Z -> Z.
(** Computes a mantissa of precision p, the corresponding exponent, and the position with respect to the real quotient of the input floating-point numbers.  The algorithm performs the following steps: - Shift dividend mantissa so that it has at least p2 + p digits. - Perform the Euclidean division. - Compute the position according to the division remainder.  Complexity is fine as long as p1 <= 2p and p2 <= p. *)

Lemma mag_div_F2R :
forall m1 e1 m2 e2,
(0 < m1)%Z -> (0 < m2)%Z ->
let e := ((Zdigits beta m1 + e1) - (Zdigits beta m2 + e2))%Z in
(e <= mag beta (F2R (Float beta m1 e1) / F2R (Float beta m2 e2)) <= e + 1)%Z.