From 2479a2a78c2450be092cd11581dd14df95bc6415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= <stepan@adjemian.eu> Date: Tue, 28 Jan 2020 18:11:55 +0100 Subject: [PATCH] Fixed bug introduced in 985d742. If a float smaller than one in absolute value is written without a leading zero in the mod file, for instance as `.5`, we really need to prefix the number with a zero. The simplest approach is to convert the strings representing the numerical constants into floats. --- src/ExprNode.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExprNode.cc b/src/ExprNode.cc index 42787045..9870c37c 100644 --- a/src/ExprNode.cc +++ b/src/ExprNode.cc @@ -451,7 +451,7 @@ void NumConstNode::writeJsonAST(ostream &output) const { output << R"({"node_type" : "NumConstNode", "value" : )"; - output << datatree.num_constants.get(id) << "}"; + output << std::stof(datatree.num_constants.get(id)) << "}"; } void -- GitLab