mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +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)
|
;(symbol-hash obj bound)
|
||||||
(modulo (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)
|
((number? obj)
|
||||||
(modulo (+ (hash (%real-part obj)) (* 3 (hash (%imag-part obj))))
|
(modulo (+ (hash (%real-part obj)) (* 3 (hash (%imag-part obj))))
|
||||||
bound))
|
bound))
|
||||||
|
|
Loading…
Add table
Reference in a new issue