(** ** Decidable equality *)

Definition Beq_dec: forall (f1 f2: binary_float), {f1 = f2} + {f1 <> f2}.Ltac try_not_eq := try solve [right; congruence].(** ** Conversion from an integer to a FP number *)

(** Integers that can be represented exactly as FP numbers. *)

Definition integer_representable (n: Z): Prop :=
  Z.abs n <= 2^emax - 2^(emax - prec) /\ generic_format radix2 fexp (Z2R n).

Lemma integer_representable_n2p_wide: forall n p, -2^prec <= n <= 2^prec -> 0 <= p -> p < emax - prec -> integer_representable (n * 2^p).