summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2011-11-26 17:11:55 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2011-11-26 17:11:55 (GMT)
commit14b4ed4b5baa0efa7eea90322faca4fecfbfa294 (patch)
tree89a983e6d631c2b43a6dd1f0fa25c8bd3969ff41 /src/value.cc
parentc2fb5d3650ffaa42c68e02891168c711d3b5f079 (diff)
parent7678f0f08305ecbc9d6f137f9deb19c60c904346 (diff)
Merge remote-tracking branch 'upstream/master' into cakebaby
and tweak tests for win32 run Conflicts: tests/test_cmdline_tool.py
Diffstat (limited to 'src/value.cc')
-rw-r--r--src/value.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc
index ab78c2a..5ea766c 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -363,7 +363,20 @@ std::string Value::toString() const
<< ']';
break;
case NUMBER:
+#ifdef OPENSCAD_TESTING
+ // Quick and dirty hack to work around floating point rounding differences
+ // across platforms for testing purposes.
+ {
+ std::stringstream tmp;
+ tmp.precision(16);
+ tmp << this->num;
+ std::string tmpstr = tmp.str();
+ if (tmpstr.size() > 16) tmpstr.erase(16);
+ stream << tmpstr;
+ }
+#else
stream << this->num;
+#endif
break;
case BOOL:
stream << (this->b ? "true" : "false");
contact: Jan Huwald // Impressum