Closed
Description
julia> round(pi)
3.0
julia> round(pi, digits=0)
3.0
julia> round(pi, digits=0, base=10)
3.0
julia> round(pi, base=10)
ERROR: MethodError: no method matching round(::Irrational{:π}, ::RoundingMode{:Nearest})
Closest candidates are:
round(::Irrational, ::RoundingMode) at irrationals.jl:137
round(::Real, ::RoundingMode; digits, sigdigits, base) at floatfuncs.jl:127
round(::Number, ::Any) at deprecated.jl:53
...
Stacktrace:
[1] _round(::Irrational{:π}, ::RoundingMode{:Nearest}, ::Nothing, ::Nothing, ::Int64) at ./floatfuncs.jl:137
#...
The error is a straight lie:
julia> round(pi, RoundingMode{:Nearest}())
3.0
Explicitly thrown here:
Lines 136 to 137 in b6a60dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment