Handle hashing of complex nums with a 0i component

This commit is contained in:
Justin Ethier 2019-02-19 13:20:29 -05:00
parent 6bfff4b6ed
commit f5b68ee8d2

View file

@ -99,7 +99,8 @@
;(symbol-hash obj bound)
(modulo (symbol-hash obj) bound)
)
((real? obj) (modulo (+ (numerator obj) (denominator obj)) bound))
((and (real? obj) (not (complex? obj)))
(modulo (+ (numerator obj) (denominator obj)) bound))
((number? obj)
(modulo (+ (hash (%real-part obj)) (* 3 (hash (%imag-part obj))))
bound))