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.
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, https://github.com/JuliaLang/julia/pull/33533#issuecomment-541210103 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.
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.
@StefanKarpinski would you mind to run PkgEval on #35823, please? Thanks!
I will once it passes its own tests. PkgEval is pretty expensive.
Yes, sorry, I made an embarrassing sign error before. 馃檲 The doctest failure now should be unrelated though.
Most helpful comment
I will once it passes its own tests. PkgEval is pretty expensive.