diff options
| author | Pierre Roux | 2020-03-28 11:07:54 +0100 |
|---|---|---|
| committer | Pierre Roux | 2020-05-09 17:58:00 +0200 |
| commit | deb2607027c158d313b82846c67594067194c8b7 (patch) | |
| tree | 66f51f9b6aee5b028ab0c4ce7985259c7710b5f4 /interp | |
| parent | 97567ffeb0e41ca5d0ee523e30a7ac0dfdbebddd (diff) | |
Rename functions
"decimal" would no longer be an appropriate name when extending to
hexadecimal for instance.
Diffstat (limited to 'interp')
| -rw-r--r-- | interp/notation.ml | 4 | ||||
| -rw-r--r-- | interp/numTok.ml | 10 | ||||
| -rw-r--r-- | interp/numTok.mli | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/interp/notation.ml b/interp/notation.ml index 7761606f11..63c539d0eb 100644 --- a/interp/notation.ml +++ b/interp/notation.ml @@ -626,7 +626,7 @@ let coqint_of_rawnum inds (sign,n) = mkApp (mkConstruct (inds.int, pos_neg), [|uint|]) let coqdecimal_of_rawnum inds n = - let i, f, e = NumTok.Signed.to_decimal_and_exponent n in + let i, f, e = NumTok.Signed.to_int_frac_and_exponent n in let i = coqint_of_rawnum inds.int i in let f = coquint_of_rawnum inds.int.uint f in match e with @@ -669,7 +669,7 @@ let rawnum_of_decimal c = let n = rawnum_of_coqint i in let f = try Some (rawnum_of_coquint f) with NotAValidPrimToken -> None in let e = match e with None -> None | Some e -> Some (rawnum_of_coqint e) in - NumTok.Signed.of_decimal_and_exponent n f e in + NumTok.Signed.of_int_frac_and_exponent n f e in match Constr.kind c with | App (_,[|i; f|]) -> of_ife i f None | App (_,[|i; f; e|]) -> of_ife i f (Some e) diff --git a/interp/numTok.ml b/interp/numTok.ml index 49165560f4..300e12f3af 100644 --- a/interp/numTok.ml +++ b/interp/numTok.ml @@ -47,8 +47,8 @@ struct 0 with Comp c -> c - let is_zero s = - compare s "0" = 0 + let is_zero s = + compare s "0" = 0 end type sign = SPlus | SMinus @@ -164,12 +164,12 @@ struct | (SPlus,{int;frac;exp}) -> UnsignedNat.is_zero int && UnsignedNat.is_zero frac | _ -> false - let of_decimal_and_exponent (sign,int) f e = + let of_int_frac_and_exponent (sign,int) f e = let exp = match e with Some e -> "e" ^ SignedNat.to_string e | None -> "" in let frac = match f with Some f -> UnsignedNat.to_string f | None -> "" in sign, { int; frac; exp } - let to_decimal_and_exponent (sign, { int; frac; exp }) = + let to_int_frac_and_exponent (sign, { int; frac; exp }) = let e = if exp = "" then None else Some (match exp.[1] with @@ -244,7 +244,7 @@ struct (i,e) let of_bigint_and_exponent i e = - of_decimal_and_exponent (SignedNat.of_bigint i) None (Some (SignedNat.of_bigint e)) + of_int_frac_and_exponent (SignedNat.of_bigint i) None (Some (SignedNat.of_bigint e)) let is_bigger_int_than (s, { int; frac; exp }) i = frac = "" && exp = "" && UnsignedNat.compare int i >= 0 diff --git a/interp/numTok.mli b/interp/numTok.mli index ea289df237..c48fad908d 100644 --- a/interp/numTok.mli +++ b/interp/numTok.mli @@ -54,8 +54,8 @@ sig val to_string : t -> string (** Convert to a non-empty sequence of digit that does not contain "_" *) - val to_bigint : t -> Bigint.bigint val of_bigint : Bigint.bigint -> t + val to_bigint : t -> Bigint.bigint end (** {6 Unsigned decimal numerals } *) @@ -118,12 +118,12 @@ sig val to_bigint : t -> Bigint.bigint option (** Convert from and to bigint when the denotation of a bigint *) - val of_decimal_and_exponent : SignedNat.t -> UnsignedNat.t option -> SignedNat.t option -> t - val to_decimal_and_exponent : t -> SignedNat.t * UnsignedNat.t option * SignedNat.t option + val of_int_frac_and_exponent : SignedNat.t -> UnsignedNat.t option -> SignedNat.t option -> t + val to_int_frac_and_exponent : t -> SignedNat.t * UnsignedNat.t option * SignedNat.t option (** n, p and q such that the number is n.p*10^q *) - val to_bigint_and_exponent : t -> Bigint.bigint * Bigint.bigint val of_bigint_and_exponent : Bigint.bigint -> Bigint.bigint -> t + val to_bigint_and_exponent : t -> Bigint.bigint * Bigint.bigint (** n and p such that the number is n*10^p *) val is_bigger_int_than : t -> UnsignedNat.t -> bool |
