-
-
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
round methods missing in base #24021
Comments
Perfect, thank you! |
This doesn't seem much nicer than using Base.Test
myround(::Type{T}, x::AbstractFloat) where T<:Union{Real,Complex} = T(round(x))
myround(::Type{T}, x::AbstractFloat, r::RoundingMode) where T<:Union{Real,Complex} = T(round(x,r))
types = [Float16, Float32, Float64, BigFloat, Complex{Float64}, Int16, Int32, Int64, BigInt]
for T in types, S in types[1:4]
@test myround(T, S(1.1))==1
@test myround(T, S(1.1)) isa T
end |
I would like to add that I would like to see https://github.com/JuliaLang/julia/blob/master/base/floatfuncs.jl#L151-153 defined with |
Referencing this discourse entry
In Julia 0.6, there seems to be some round methods missing for basic types in
Base
:I interpreted @StefanKarpinski 's entry as a request to file an issue. I hope I did the right thing ?
The text was updated successfully, but these errors were encountered: