diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2011-11-26 18:17:54 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2011-11-26 18:17:54 (GMT) |
commit | 8197294d4c30d533c88ef2901e298d2b2863aa87 (patch) | |
tree | 7f26004c4b4d1ae12970913ea4d0201be5c50088 /src/value.cc | |
parent | 2bd48629ef8482a957f7db0921a3b3c7fdc458e1 (diff) | |
parent | 14b4ed4b5baa0efa7eea90322faca4fecfbfa294 (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.cc | 13 |
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"); |