fact: Definition of_decimal (d : Decimal.decimal) : IR := let '(i, f, e) := match d with | Decimal.Decimal i f => (i, f, Decimal.Pos Decimal.Nil) | Decimal.DecimalExp i f e => (i, f, e) end in let zq := match f with | Decimal.Nil => IRZ (IZ_of_Z (Z.of_int i)) | _ => let num := Z.of_int (Decimal.app_int i f) in let den := Nat.iter (Decimal.nb_digits f) (Pos.mul 10) 1%positive in IRQ (Qmake num den) end in let e := Z.of_int e in match e with | Z0 => zq | Zpos e => IRmult zq (IRZ (IZpow_pos 10 e)) | Zneg e => IRdiv zq (IRZ (IZpow_pos 10 e)) end.
imports: ZArith_base QArith_base ConstructiveCauchyReals ConstructiveCauchyRealsMult ConstructiveRcomplete ClassicalDedekindReals