diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-03-15 15:05:11 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-03-15 15:05:11 +0100 |
commit | 4b0f05cf84ac5d38f8e31aa7b8f7c9e1b0617ea0 (patch) | |
tree | a52ac11cdc92b969748e6086af116e2613dba21a /driver/Interp.ml | |
parent | 2f31ded1ab2a78f1362b95b6079023c94909fe6b (diff) | |
download | compcert-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 'driver/Interp.ml')
-rw-r--r-- | driver/Interp.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/Interp.ml b/driver/Interp.ml index fb1c85f0..4b6d0a44 100644 --- a/driver/Interp.ml +++ b/driver/Interp.ml @@ -45,8 +45,8 @@ let print_id_ofs p (id, ofs) = let print_eventval p = function | EVint n -> fprintf p "%ld" (camlint_of_coqint n) - | EVfloat f -> fprintf p "%F" (camlfloat_of_coqfloat f) - | EVsingle f -> fprintf p "%F" (camlfloat_of_coqfloat32 f) + | EVfloat f -> fprintf p "%.15F" (camlfloat_of_coqfloat f) + | EVsingle f -> fprintf p "%.15F" (camlfloat_of_coqfloat32 f) | EVlong n -> fprintf p "%LdLL" (camlint64_of_coqint n) | EVptr_global(id, ofs) -> fprintf p "&%a" print_id_ofs (id, ofs) |