diff --git a/src/math/prearith/floorceiltrunc.jl b/src/math/prearith/floorceiltrunc.jl index 31eeb370..31a03f46 100644 --- a/src/math/prearith/floorceiltrunc.jl +++ b/src/math/prearith/floorceiltrunc.jl @@ -74,11 +74,11 @@ function round(x::DoubleFloat{T}, ::RoundingMode{:Down}) where {T<:IEEEFloat} return floor(x) end -function round(x::DoubleFloat{T}, ::RoundingMode{:RoundToZero}) where {T<:IEEEFloat} +function round(x::DoubleFloat{T}, ::RoundingMode{:ToZero}) where {T<:IEEEFloat} return isnegative(x) ? ceil(x) : floor(x) end -function round(x::DoubleFloat{T}, ::RoundingMode{:RoundFromZero}) where {T<:IEEEFloat} +function round(x::DoubleFloat{T}, ::RoundingMode{:FromZero}) where {T<:IEEEFloat} return isnegative(x) ? floor(x) : ceil(x) end diff --git a/test/prearith.jl b/test/prearith.jl index f678d113..20093a81 100644 --- a/test/prearith.jl +++ b/test/prearith.jl @@ -59,3 +59,6 @@ end @test 6.0 == @eval tld($T(pi), 0.5) end +@testset "#176" begin + @test round(Double16(pi), RoundToZero) == 3 +end