-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
no method round(MathConst{:π})
#5561
Comments
The Forio tutorial could be updated to use the 2-arg form. But there is also inconsistent behavior like this:
|
Other than conversion-related functions, only +,-,*,/,^ are implemented for MathConsts. Adding every function is not practical. So, we obviously need a more systematic approach for "exotic" kinds of numbers that are not going to have every function implemented just for them. MathConst and Float16 are good examples --- rather than re-implement all of libm for them, we want to convert to a standard type, then possibly convert back. Perhaps a function like |
What about just bringing back the old definition of |
This could be partially handled with generic apply. I.e. |
@nolta: forcing people to use Unicode to get a correctly behaved generic pi seems wrong. |
Call it |
A definition like that would be ambiguous with an ordinary definition of a particular generic function for a type like |
We could just prompt the user to do their own conversion, though that still requires a |
This issue is marked as up for grabs and intro issue, but in light of the conversation at #21535 ( |
Would the missing method julia> round(Int, pi)
ERROR: MethodError: no method matching round(::Type{Int64}, ::Irrational{:π})
Closest candidates are:
round(::Type{T<:Integer}, ::Integer) where T<:Integer at int.jl:524
round(::Type{T<:Integer}, ::Float16) where T<:Integer at float.jl:356
round(::Type{T<:Union{Signed, Unsigned}}, ::BigFloat) where T<:Union{Signed, Unsigned} at mpfr.jl:229
...
julia> VERSION
v"0.7.0-DEV.3507" fall under this issue? Asking because so much of the interface changed since it was opened.
|
|
reported here
The text was updated successfully, but these errors were encountered: