mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-18 21:29:18 +02:00
Handle hashing of complex nums with a 0i component
This commit is contained in:
parent
6bfff4b6ed
commit
f5b68ee8d2
1 changed files with 2 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue