Incorrect result in gcd procedure

Issue #199 resolved
Former user created an issue

Function gcd n1 ...

Function lcm n1 ...

[R6RS] These procedures return the greatest common divisor or least common multiple of their arguments. The result is always non-negative.

(display (gcd -165543184715050652143983385447792 15946333291432216432322993695213691))

-2112366845

Comments (2)

  1. Takashi Kato repo owner

    Thank you for the report!

    I've just confirmed the issue. It seems implementation of binary_gcd is wrong.

  2. Log in to comment