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 /powerpc/PrintOp.ml | |
parent | 2f31ded1ab2a78f1362b95b6079023c94909fe6b (diff) | |
download | compcert-4b0f05cf84ac5d38f8e31aa7b8f7c9e1b0617ea0.tar.gz compcert-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 'powerpc/PrintOp.ml')
-rw-r--r-- | powerpc/PrintOp.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/powerpc/PrintOp.ml b/powerpc/PrintOp.ml index b0213014..a3fac2c3 100644 --- a/powerpc/PrintOp.ml +++ b/powerpc/PrintOp.ml @@ -48,8 +48,8 @@ let print_condition reg pp = function let print_operation reg pp = function | Omove, [r1] -> reg pp r1 | Ointconst n, [] -> fprintf pp "%ld" (camlint_of_coqint n) - | Ofloatconst n, [] -> fprintf pp "%F" (camlfloat_of_coqfloat n) - | Osingleconst n, [] -> fprintf pp "%Ff" (camlfloat_of_coqfloat32 n) + | Ofloatconst n, [] -> fprintf pp "%.15F" (camlfloat_of_coqfloat n) + | Osingleconst n, [] -> fprintf pp "%.15Ff" (camlfloat_of_coqfloat32 n) | Oaddrsymbol(id, ofs), [] -> fprintf pp "\"%s\" + %ld" (extern_atom id) (camlint_of_coqint ofs) | Oaddrstack ofs, [] -> |