From 7c2c43fe2422402d2ae36fe4404d922e620b6c5f Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 16 Dec 2022 01:20:42 +0100 Subject: [PATCH] Precise to what extent considering integers work fine with working with floats instead --- src/ast_to_c.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ast_to_c.ml b/src/ast_to_c.ml index ff4e5f7..0390814 100644 --- a/src/ast_to_c.ml +++ b/src/ast_to_c.ml @@ -199,7 +199,7 @@ let rec pp_equations node_name fmt: t_eqlist -> unit = function (* By prepending to the `Format.formatter` `fmt` we could just declare these arrays once with a size of the maximum `reset_expressions_counter` *) let pp_resvars reset_expressions_counter = - (* use the fact that any boolean and any integer can be encoded as a float *) + (* use the fact that any boolean and any integer can be encoded as a float, concerning integers [-2^(23+1) + 1; 2^(23+1) + 1] are correctly encoded (cf https://stackoverflow.com/a/53254438) *) Format.sprintf "float tmp_reset[%i], init[%i];" reset_expressions_counter reset_expressions_counter (* TODO: manage general outputs *)