summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-11-26 18:17:54 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-11-26 18:17:54 (GMT)
commit8197294d4c30d533c88ef2901e298d2b2863aa87 (patch)
tree7f26004c4b4d1ae12970913ea4d0201be5c50088 /src/value.cc
parent2bd48629ef8482a957f7db0921a3b3c7fdc458e1 (diff)
parent14b4ed4b5baa0efa7eea90322faca4fecfbfa294 (diff)
Merge branch 'cakebaby' of github.com:donbright/openscad into cakebaby
Conflicts: tests/CMakeLists.txt
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