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

Promote on Rational binary operations #36279

Merged
merged 2 commits into from
Jun 16, 2020

Conversation

Liozou
Copy link
Member

@Liozou Liozou commented Jun 14, 2020

Fix #36277

I think this is a bugfix (see issue) that needs backporting to the 1.5 branch.

@sostock
Copy link
Contributor

sostock commented Jun 14, 2020

Note that this restores the pre-1.5 behavior of *(::Rational, ::Integer) and *(::Integer, ::Rational), but it changes the behavior of *(x::Rational, y::Rational), which didn’t use promotion before.

@Liozou
Copy link
Member Author

Liozou commented Jun 14, 2020

Note that this restores the pre-1.5 behavior of *(::Rational, ::Integer) and *(::Integer, ::Rational), but it changes the behavior of *(x::Rational, y::Rational), which didn’t use promotion before.

That's a fair point. But I think that's a good thing since it makes the return types more consistent. when using binary operations with either Rationals or Integers.

@dkarrasch dkarrasch added the domain:rationals The Rational type and values thereof label Jun 14, 2020
@JeffBezanson JeffBezanson merged commit 6c760d2 into JuliaLang:master Jun 16, 2020
KristofferC pushed a commit that referenced this pull request Jun 16, 2020
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 11, 2020
@Liozou Liozou deleted the rationalbinarypromotion branch December 26, 2021 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:rationals The Rational type and values thereof
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return type of *(::Rational, ::Integer) changed in 1.5
6 participants