Skip to content

Conversation

@KlausC
Copy link
Contributor

@KlausC KlausC commented May 27, 2021

Currently we have

gcd(-12) === -12
gcd([-12]) === 12 === gcd(0, -12)

Same for lcm.
The positive value would make the outcomes above consistent and be in line with e.g. WolframAlpha. (MATLAB does not support one-arg form).

@oscardssmith oscardssmith added bugfix This change fixes an existing bug maths Mathematical functions labels May 27, 2021
@vtjnash vtjnash merged commit fb42ea5 into JuliaLang:master May 29, 2021
@vtjnash vtjnash added the backport 1.6 Change should be backported to release-1.6 label May 29, 2021
KristofferC pushed a commit that referenced this pull request Jun 4, 2021
shirodkara pushed a commit to shirodkara/julia that referenced this pull request Jun 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
@KristofferC KristofferC mentioned this pull request Jul 12, 2021
75 tasks
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Jul 12, 2021
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug maths Mathematical functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants