aboutsummaryrefslogtreecommitdiffstats
path: root/common/PrintAST.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2016-03-15 15:05:11 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2016-03-15 15:05:11 +0100
commit4b0f05cf84ac5d38f8e31aa7b8f7c9e1b0617ea0 (patch)
treea52ac11cdc92b969748e6086af116e2613dba21a /common/PrintAST.ml
parent2f31ded1ab2a78f1362b95b6079023c94909fe6b (diff)
downloadcompcert-kvx-4b0f05cf84ac5d38f8e31aa7b8f7c9e1b0617ea0.tar.gz
compcert-kvx-4b0f05cf84ac5d38f8e31aa7b8f7c9e1b0617ea0.zip
Print floating-point numbers with more digits in debug outputs
As suggested in GPR#84, use '%.15F' to force the printing of more significant digits. (The '%F' format previously used prints only 6.) This is enough to represent the FP number exactly most of the time (but not always). Once OCaml 4.03 is out and CompCert switches to this version of OCaml, we'll be able to use hexadecimal floats for printing.
Diffstat (limited to 'common/PrintAST.ml')
-rw-r--r--common/PrintAST.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/PrintAST.ml b/common/PrintAST.ml
index 39481bfb..4994026a 100644
--- a/common/PrintAST.ml
+++ b/common/PrintAST.ml
@@ -55,8 +55,8 @@ let rec print_builtin_arg px oc = function
| BA x -> px oc x
| BA_int n -> fprintf oc "int %ld" (camlint_of_coqint n)
| BA_long n -> fprintf oc "long %Ld" (camlint64_of_coqint n)
- | BA_float n -> fprintf oc "float %F" (camlfloat_of_coqfloat n)
- | BA_single n -> fprintf oc "single %F" (camlfloat_of_coqfloat32 n)
+ | BA_float n -> fprintf oc "float %.15F" (camlfloat_of_coqfloat n)
+ | BA_single n -> fprintf oc "single %.15F" (camlfloat_of_coqfloat32 n)
| BA_loadstack(chunk, ofs) ->
fprintf oc "%s[sp + %ld]" (name_of_chunk chunk) (camlint_of_coqint ofs)
| BA_addrstack(ofs) ->