From 6087efa0b68ae3a1b003dac86970719728976395 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Wed, 24 Sep 2014 14:39:49 +0200 Subject: Refactoring in the printing of FP numbers. --- exportclight/ExportClight.ml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'exportclight/ExportClight.ml') diff --git a/exportclight/ExportClight.ml b/exportclight/ExportClight.ml index fe2cfded..e4d1ce53 100644 --- a/exportclight/ExportClight.ml +++ b/exportclight/ExportClight.ml @@ -127,16 +127,10 @@ let coqint64 p n = else fprintf p "(Int64.repr (%Ld))" n let coqfloat p n = - let n = camlint64_of_coqint(Floats.Float.to_bits n) in - if n >= 0L - then fprintf p "(Float.of_bits (Int64.repr %Ld))" n - else fprintf p "(Float.of_bits (Int64.repr (%Ld)))" n + fprintf p "(Float.of_bits %a)" coqint64 (Floats.Float.to_bits n) let coqsingle p n = - let n = camlint_of_coqint(Floats.Float32.to_bits n) in - if n >= 0l - then fprintf p "(Float32.of_bits (Int.repr %ld))" n - else fprintf p "(Float32.of_bits (Int.repr (%ld)))" n + fprintf p "(Float32.of_bits %a)" coqint (Floats.Float32.to_bits n) (* Types *) -- cgit