diff options
author | Boris Vassilev <boris.vassilev@gmail.com> | 2015-05-13 13:00:20 +0300 |
---|---|---|
committer | Boris Vassilev <boris.vassilev@gmail.com> | 2015-05-13 13:00:20 +0300 |
commit | 9723e30647c855a1e87029310b2e28bdf95cd398 (patch) | |
tree | 57484ace0c1f4a79e21974249ce7d7c6442864ce | |
parent | 0b184f2584221543a7dec9c8ae4a700533919e0c (diff) | |
download | Nim-9723e30647c855a1e87029310b2e28bdf95cd398.tar.gz |
Document explicitly the behaviour of math.gcd with float arguments
-rw-r--r-- | lib/pure/math.nim | 3 |
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 |