Section format_REM.
Variable beta : radix.
Notation bpow e := (bpow beta e).
Variable fexp : Z -> Z.
Context { valid_exp : Valid_exp fexp }.
Context { monotone_exp : Monotone_exp fexp }.
Notation format := (generic_format beta fexp).

Theorem format_REM :
forall rnd : R -> Z, Valid_rnd rnd ->
forall x y : R,
((Rabs (x/y) < /2)%R -> rnd (x/y)%R = 0%Z) ->
format x -> format y ->
format (x - IZR (rnd (x/y)%R) * y).