From 3def943d046ad03540dd188ab52c0eacaa021149 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 5 Mar 2013 20:04:53 +0000 Subject: users/17665: add FORCE_FLOAT option --- Src/math.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Src/math.c') diff --git a/Src/math.c b/Src/math.c index e90d6a59a..f8a4eefeb 100644 --- a/Src/math.c +++ b/Src/math.c @@ -456,6 +456,11 @@ lexconstant(void) yyval.u.l = zstrtol_underscore(ptr, &ptr, 0, 1); /* Should we set lastbase here? */ lastbase = 16; + if (isset(FORCEFLOAT)) + { + yyval.type = MN_FLOAT; + yyval.u.d = (double)yyval.u.l; + } return NUM; } else if (isset(OCTALZEROES)) @@ -475,6 +480,11 @@ lexconstant(void) { yyval.u.l = zstrtol_underscore(ptr, &ptr, 0, 1); lastbase = 8; + if (isset(FORCEFLOAT)) + { + yyval.type = MN_FLOAT; + yyval.u.d = (double)yyval.u.l; + } return NUM; } nptr = ptr2; @@ -537,6 +547,11 @@ lexconstant(void) lastbase = yyval.u.l; yyval.u.l = zstrtol_underscore(ptr, &ptr, lastbase, 1); } + if (isset(FORCEFLOAT)) + { + yyval.type = MN_FLOAT; + yyval.u.d = (double)yyval.u.l; + } } return NUM; } -- cgit 1.4.1