summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Plumb <andrew@plumb.org>2012-02-19 00:08:06 (GMT)
committerAndrew Plumb <andrew@plumb.org>2012-02-19 00:08:06 (GMT)
commit65c3acf5e66428948b9bcaaff507e962494e3bc1 (patch)
treefbcd75032aed797bf6aadda5895d3f230a683110 /src
parentbd5aac6f96ac7ecf3613fd81999bd82605925562 (diff)
parentcf52a2a1ef1a7af5ed07d3e4fce1ad430f1321ef (diff)
Merge remote-tracking branch 'upstream/master' into fonts_search_example
Diffstat (limited to 'src')
-rw-r--r--src/value.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc
index 48fea1a..c9dbd55 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -426,6 +426,10 @@ std::string Value::toString() const
// Quick and dirty hack to work around floating point rounding differences
// across platforms for testing purposes.
{
+ if (this->num != this->num) { // Fix for avoiding nan vs. -nan across platforms
+ stream << "nan";
+ break;
+ }
std::stringstream tmp;
tmp.precision(12);
tmp.setf(std::ios_base::fixed);
contact: Jan Huwald // Impressum