Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcd and lcm fixed for one negative argument #40968

Merged
merged 1 commit into from
May 29, 2021
Merged

gcd and lcm fixed for one negative argument #40968

merged 1 commit into from
May 29, 2021

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 kind:bugfix This change fixes an existing bug domain: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
domain:maths Mathematical functions kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants