lib/pure/p-t - Dropped 'T' from types

This commit is contained in:
pdw 2015-05-24 22:34:41 -05:00 • committed by Araq
commit d18e18060e
13 changed files with 89 additions and 84 deletions

View file

@ -206,13 +206,13 @@ proc abs*[T](x: Rational[T]): Rational[T] =
result.num = abs x.num
result.den = abs x.den
proc hash*[T](x: Rational[T]): THash =
proc hash*[T](x: Rational[T]): Hash =
## Computes hash for rational `x`
# reduce first so that hash(x) == hash(y) for x == y
var copy = x
reduce(copy)
var h: THash = 0
var h: Hash = 0
h = h !& hash(copy.num)
h = h !& hash(copy.den)
result = !$h