summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-02-18 17:37:26 (GMT)
committerMarius Kintel <marius@kintel.net>2012-02-18 17:37:26 (GMT)
commit6652ede2c2167b2eb2ca685002710764d0986299 (patch)
tree8eda29a7bbb681195e75d4409815f190dff226ec /src/value.cc
parenta232426798df0501539bd2e7831258ad61f927ba (diff)
nan vs. -nan fix to make inf-tests work under Linux
Diffstat (limited to 'src/value.cc')
-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