From 9723e30647c855a1e87029310b2e28bdf95cd398 Mon Sep 17 00:00:00 2001 From: Boris Vassilev Date: Wed, 13 May 2015 13:00:20 +0300 Subject: Document explicitly the behaviour of math.gcd with float arguments --- lib/pure/math.nim | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit 1.4.1-2-gfad0