From e97ef96f30b4a08cc20cf1f755892ca56bafa046 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Sat, 13 Nov 2021 02:23:48 -0700 Subject: [PATCH 1/2] Fixes issue with small numbers reported as zero in SAM issue 458 --- src/env.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/env.cpp b/src/env.cpp index 4d79f87..8f78969 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -127,7 +127,7 @@ lk_string lk::vardata_t::as_string() const { if (((double) ((int) m_u.v)) == m_u.v) sprintf(buf, "%d", (int) m_u.v); else - sprintf(buf, "%lf", m_u.v); + sprintf(buf, "%lg", m_u.v); return lk_string(buf); } case STRING: From f494a169c1256bb8574ab722ba5f69dd58e6fe19 Mon Sep 17 00:00:00 2001 From: Steven Janzou Date: Sat, 13 Nov 2021 05:16:34 -0700 Subject: [PATCH 2/2] remove unused variable and comment --- src/env.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/env.cpp b/src/env.cpp index 8f78969..cdf48f7 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -116,7 +116,6 @@ int lk::vardata_t::as_integer() const { } lk_string lk::vardata_t::as_string() const { -// double intpart; char buf[512]; switch (type()) { case NULLVAL: