-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
sinc(π) not defined #7994
Comments
See also #5561. It's not clear where to stop adding definitions for |
Yikes. Decompose should not really be called on MathConsts since they're typically not rational. |
There are of course simple workarounds for this by writing e.g. But still I do not understand why the |
I would never have guessed that this was the problem: julia> isinf(pi)
ERROR: `decompose` has no method matching decompose(::MathConst{:π})
in isinf at float.jl:217 @EthanAnderes Note that the |
Maybe the concept behind
Maybe one could have |
@simonbyrne That did initially trip me up. In fact, I was testing sinc(\pi) after seeing my code had a misspecified phase, ... then ran into it not being defined. Obviously, not a big deal but I figured someone would want to know about it. Hence the issue here. Thanks for looking into it. Cheers. |
Regardless, I feel like (Although |
So, on latest master... julia> sinc(π)
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type Irrational{:π}
This may have arisen from a call to the constructor Irrational{:π}(...),
since type constructors fall back to convert methods.
in sinpi(::Irrational{:π}) at ./special/trig.jl:159
in sinc(::Irrational{:π}) at ./special/trig.jl:296
julia> sinc(3.1415926535897)
-0.04359862862916225 |
It appears to be due to this:
|
It seems reasonable to define |
I don't know: defining |
Hmm. This is a pretty tricky issue. We really want |
According to |
julia> sinc(π)
-0.04359862862918775 |
The function sinc doesn't seem to be defined for π.
The text was updated successfully, but these errors were encountered: