hash() for floats

This commit is contained in:
Simon Hafner 2012-09-08 15:15:28 -05:00
commit 1852c0548c
2 changed files with 11 additions and 0 deletions

View file

@ -122,3 +122,7 @@ proc hash*[T: tuple](x: T): THash =
result = result !& hash(f)
result = !$result
proc hash*(x: float): THash {.inline.} =
var y = x + 1.0
result = cast[ptr THash](addr(y))[]