summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorpgkos <pg.kosinski@gmail.com>2016-03-18 16:59:15 +0100
committerpgkos <pg.kosinski@gmail.com>2016-03-18 16:59:15 +0100
commitef889a100967e40256cf44eb5d7fd74acddc9087 (patch)
treeec6eab1cddb7572335d8e465eeaff003f175b0fb /lib
parent669917c72605283824c7bea2b13fa91fc494905b (diff)
downloadNim-ef889a100967e40256cf44eb5d7fd74acddc9087.tar.gz
Fixed a typo in proc `-`(x: T, y: Rational[T])
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/rationals.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/rationals.nim b/lib/pure/rationals.nim
index 72c64befc..6fd05dc4b 100644
--- a/lib/pure/rationals.nim
+++ b/lib/pure/rationals.nim
@@ -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]) =