diff --git a/M2/Macaulay2/d/basic.d b/M2/Macaulay2/d/basic.d index 21b6ad1ca2..f0a22f9a83 100644 --- a/M2/Macaulay2/d/basic.d +++ b/M2/Macaulay2/d/basic.d @@ -11,7 +11,7 @@ export hash(e:Expr):hash_t := ( is s:SymbolBody do s.symbol.hash is x:Database do x.hash is x:ZZcell do hash(x.v) - is b:Boolean do if b.v then hash_t(444777) else hash_t(777333) + is b:Boolean do Ccode(hash_t, b.v) is Nothing do hash_t(333889) is x:List do x.hash is f:functionCode do f.hash diff --git a/M2/Macaulay2/m2/basictests/hashcodes.m2 b/M2/Macaulay2/m2/basictests/hashcodes.m2 index 92b4f0ccbc..a859028b95 100644 --- a/M2/Macaulay2/m2/basictests/hashcodes.m2 +++ b/M2/Macaulay2/m2/basictests/hashcodes.m2 @@ -18,8 +18,8 @@ assert( (hash Nothing) === 1000069 ) assert( (hash (1 => 2)) === 1729140528276943882 ) assert( hash Nothing == 1000069 ) assert( (hash Boolean) === 1000035 ) -assert( (hash true) === 444777 ) -assert( (hash false) === 777333 ) +assert( (hash true) === 1 ) +assert( (hash false) === 0 ) -- these might change if our floating point implementation changes, but let's check anyway: assert( hash 1.23p200 === 18446744072207201388 -* 64-bit *- or hash 1.23p200 == 18446744073069319069 -* 32-bit *- )