From 31c8d0af1597b6b4996a90808b1b8c0983db309e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 6 Jun 2024 16:20:36 -0400 Subject: Fix float literals for integer floats --- compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile.c b/compile.c index b6e26c84..a696ac87 100644 --- a/compile.c +++ b/compile.c @@ -1025,7 +1025,7 @@ CORD compile(env_t *env, ast_t *ast) } case Int: return CORD_asprintf("I%ld(%ld)", Match(ast, Int)->bits, Match(ast, Int)->i); case Num: { - return CORD_asprintf(Match(ast, Num)->bits == 64 ? "%.9g" : "%.9gf", Match(ast, Num)->n); + return CORD_asprintf(Match(ast, Num)->bits == 64 ? "%.9g" : "(float)%.9g", Match(ast, Num)->n); } case Length: { ast_t *expr = Match(ast, Length)->value; -- cgit v1.2.3