Section Format.
Variable fexp : Z -> Z.
(** To be a good fexp *)
Class Valid_exp :=
valid_exp :
forall k : Z,
( (fexp k < k)%Z -> (fexp (k + 1) <= k)%Z ) /\
( (k <= fexp k)%Z ->
(fexp (fexp k + 1) <= fexp k)%Z /\
forall l : Z, (l <= fexp k)%Z -> fexp l = fexp k ).
Context { valid_exp_ : Valid_exp }.
Definition cexp x :=
fexp (mag beta x).
Definition canonical (f : float beta) :=
Fexp f = cexp (F2R f).
Definition scaled_mantissa x :=
(x * bpow (- cexp x))%R.
Definition generic_format (x : R) :=
x = F2R (Float beta (Ztrunc (scaled_mantissa x)) (cexp x)).

(** Generic facts about any format *)
Theorem generic_format_discrete :
forall x m,
let e := cexp x in
(F2R (Float beta m e) < x < F2R (Float beta (m + 1) e))%R ->
~ generic_format x.