diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-05-13 16:34:36 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-05-13 16:34:36 +0200 |
commit | 2dee0324f30722dbbc4ce44c68d6976e9419c25e (patch) | |
tree | 389f01932a166150f53d30cd42af94b69c7045d4 /lib/pure/math.nim | |
parent | ce2756dd899fadac174223363c003a4f6e704f4d (diff) | |
parent | 9723e30647c855a1e87029310b2e28bdf95cd398 (diff) | |
download | Nim-2dee0324f30722dbbc4ce44c68d6976e9419c25e.tar.gz |
Merge pull request #2705 from borisvassilev/gcddocs
Document explicitly the behaviour of math.gcd with float arguments
Diffstat (limited to 'lib/pure/math.nim')
-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 |