Commit 079382f0 authored by Christoph Groth's avatar Christoph Groth
Browse files

make code compile with msvc 9

parent 0218772e
......@@ -802,12 +802,12 @@ long hash(double x)
const double two_to_31st = 2147483648.0;
double intpart, fractpart;
if (!std::isfinite(x)) {
if (std::isinf(x))
return x < 0 ? -271828 : 314159;
else
return 0;
}
if (x == std::numeric_limits<double>::infinity())
return 314159;
else if (x == -std::numeric_limits<double>::infinity())
return -271828;
else if (x != x)
return 0; // NaN
fractpart = modf(x, &intpart);
if (fractpart == 0) {
......
......@@ -239,7 +239,7 @@ def test_hash_equality():
if thing == thing:
assert arr == thing
assert not (arr != thing)
assert hash(arr) == hash(thing)
assert_equal(hash(arr), hash(thing))
def test_broadcasting():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment