Merge pull request #3980 from pgkos/rational-subtraction-fix
Fixed a typo in rational number subtraction proc
This commit is contained in:
commit
4457b0980f
1 changed files with 1 additions and 1 deletions
|
|
@ -164,7 +164,7 @@ proc `-` *[T](x: Rational[T], y: T): Rational[T] =
|
|||
|
||||
proc `-` *[T](x: T, y: Rational[T]): Rational[T] =
|
||||
## Subtract rational `y` from int `x`.
|
||||
result.num = - x * y.den + y.num
|
||||
result.num = x * y.den - y.num
|
||||
result.den = y.den
|
||||
|
||||
proc `-=` *[T](x: var Rational[T], y: Rational[T]) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue