fact: Definition to_hexadecimal (n : IQ) : option Hexadecimal.hexadecimal := match n with | IQmake num den => IQmake_to_hexadecimal' num den | IQmult (IQmake num den) (IQmake (IZpow_pos 2 e) 1) => match IQmake_to_hexadecimal' num den with | Some (Hexadecimal.Hexadecimal i f) => Some (Hexadecimal.HexadecimalExp i f (Pos.to_int e)) | _ => None end | IQdiv (IQmake num den) (IQmake (IZpow_pos 2 e) 1) => match IQmake_to_hexadecimal' num den with | Some (Hexadecimal.Hexadecimal i f) => Some (Hexadecimal.HexadecimalExp i f (Decimal.Neg (Pos.to_uint e))) | _ => None end | _ => None end.
imports: ZArith_base ZArithRing ZArith.BinInt Morphisms Setoid Bool