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

Should sinpi and cospi return integers for integer input? #35820

Closed
simeonschaub opened this issue May 9, 2020 · 6 comments
Closed

Should sinpi and cospi return integers for integer input? #35820

simeonschaub opened this issue May 9, 2020 · 6 comments

Comments

@simeonschaub
Copy link
Member

I think returning floating point numbers for integer inputs doesn't make much sense, since the results are always integer. sinpi is especially weird, since it returns differently signed zeros for positive and negative integer inputs. In #33341, it was also discussed that cospi is actually the inverse of signbit, in which case integer output would also make a lot more sense. Is there a particular reason for the current behavior? Changing the output type might be too breaking for a minor release, but it would at least make sense to reconsider for 2.0.

@jonas-schulze
Copy link
Contributor

I fully agree that sinpi and cospi should map integers to integers. If there wouldn't be "minor breaking" changes in julia (e.g. #34200, #33864, #33533 (comment) and likely more), I'd say this is something for 2.0. Though, those issues are arguably of greater range, so I'm leaning towards 2.0.

@StefanKarpinski
Copy link
Member

Changing the type of a function like this would be potentially eligible for a minor release, but we'd have to run PkgEval to see if there's any negative fallout in the ecosystem. If there aren't any problems, then we could potentially change it before 2.0.

@jonas-schulze
Copy link
Contributor

@StefanKarpinski would you mind to run PkgEval on #35823, please? Thanks!

@StefanKarpinski
Copy link
Member

I will once it passes its own tests. PkgEval is pretty expensive.

@simeonschaub
Copy link
Member Author

simeonschaub commented May 12, 2020

Yes, sorry, I made an embarrassing sign error before. 🙈 The doctest failure now should be unrelated though.

@vtjnash
Copy link
Member

vtjnash commented Feb 16, 2022

Rejected in #35823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants