Skip to content

Commit 87ba8de

Browse files
authored
Merge pull request #177 from LilithHafner/patch-1
Fix typo in rounding
2 parents 4416838 + 1bb0f70 commit 87ba8de

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/math/prearith/floorceiltrunc.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ function round(x::DoubleFloat{T}, ::RoundingMode{:Down}) where {T<:IEEEFloat}
7474
return floor(x)
7575
end
7676

77-
function round(x::DoubleFloat{T}, ::RoundingMode{:RoundToZero}) where {T<:IEEEFloat}
77+
function round(x::DoubleFloat{T}, ::RoundingMode{:ToZero}) where {T<:IEEEFloat}
7878
return isnegative(x) ? ceil(x) : floor(x)
7979
end
8080

81-
function round(x::DoubleFloat{T}, ::RoundingMode{:RoundFromZero}) where {T<:IEEEFloat}
81+
function round(x::DoubleFloat{T}, ::RoundingMode{:FromZero}) where {T<:IEEEFloat}
8282
return isnegative(x) ? floor(x) : ceil(x)
8383
end
8484

test/prearith.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ end
5959
@test 6.0 == @eval tld($T(pi), 0.5)
6060
end
6161

62+
@testset "#176" begin
63+
@test round(Double16(pi), RoundToZero) == 3
64+
end

0 commit comments

Comments
 (0)