summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-05-13 16:34:36 +0200
committerAndreas Rumpf <rumpf_a@web.de>2015-05-13 16:34:36 +0200
commit2dee0324f30722dbbc4ce44c68d6976e9419c25e (patch)
tree389f01932a166150f53d30cd42af94b69c7045d4 /lib
parentce2756dd899fadac174223363c003a4f6e704f4d (diff)
parent9723e30647c855a1e87029310b2e28bdf95cd398 (diff)
downloadNim-2dee0324f30722dbbc4ce44c68d6976e9419c25e.tar.gz
Merge pull request #2705 from borisvassilev/gcddocs
Document explicitly the behaviour of math.gcd with float arguments
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/math.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim
index cb58ea39b..a9e9010f6 100644
--- a/lib/pure/math.nim
+++ b/lib/pure/math.nim
@@ -352,6 +352,9 @@ proc `^`*[T](x, y: T): T =
 
 proc gcd*[T](x, y: T): T =
   ## Computes the greatest common divisor of ``x`` and ``y``.
+  ## Note that for floats, the result cannot always be interpreted as
+  ## "greatest decimal `z` such that ``z*N == x and z*M == y``
+  ## where N and M are positive integers."
   var (x,y) = (x,y)
   while y != 0:
     x = x mod y