aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Roux2020-03-28 11:07:54 +0100
committerPierre Roux2020-05-09 17:58:00 +0200
commitdeb2607027c158d313b82846c67594067194c8b7 (patch)
tree66f51f9b6aee5b028ab0c4ce7985259c7710b5f4
parent97567ffeb0e41ca5d0ee523e30a7ac0dfdbebddd (diff)
Rename functions
"decimal" would no longer be an appropriate name when extending to hexadecimal for instance.
-rw-r--r--interp/notation.ml4
-rw-r--r--interp/numTok.ml10
-rw-r--r--interp/numTok.mli8
-rw-r--r--plugins/syntax/float_syntax.ml2
-rw-r--r--plugins/syntax/r_syntax.ml2
5 files changed, 13 insertions, 13 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
diff --git a/plugins/syntax/float_syntax.ml b/plugins/syntax/float_syntax.ml
index e0a9906689..0a5825dfc1 100644
--- a/plugins/syntax/float_syntax.ml
+++ b/plugins/syntax/float_syntax.ml
@@ -42,7 +42,7 @@ let interp_float ?loc n =
| Float64.(PZero | NZero) -> not (NumTok.Signed.is_zero n)
| Float64.(PNormal | NNormal | PSubn | NSubn) ->
let m, e =
- 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 = NumTok.UnsignedNat.to_string i in
let f = match f with
| None -> "" | Some f -> NumTok.UnsignedNat.to_string f in
diff --git a/plugins/syntax/r_syntax.ml b/plugins/syntax/r_syntax.ml
index c4e9c8b73d..b5f11d9025 100644
--- a/plugins/syntax/r_syntax.ml
+++ b/plugins/syntax/r_syntax.ml
@@ -163,7 +163,7 @@ let rawnum_of_r c =
else "0", String.make (e - ni) '0' ^ i in
let i = s, NumTok.UnsignedNat.of_string i in
let f = NumTok.UnsignedNat.of_string f in
- NumTok.Signed.of_decimal_and_exponent i (Some f) None in
+ NumTok.Signed.of_int_frac_and_exponent i (Some f) None in
if choose_exponent then numTok_exponent () else numTok_dot () in
match DAst.get c with
| GApp (r, [a]) when is_gr r glob_IZR ->