Skip to content

Commit

Permalink
convert ArbRoundExact to RoundingMode{:Exact} instead of RoundNearest
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-Dahne committed Feb 6, 2024
1 parent 4c86bf5 commit ecebae9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ function Base.convert(::Type{RoundingMode}, r::arb_rnd)
elseif r == ArbRoundNearest
return RoundNearest
elseif r == ArbRoundExact
# No RoundExact, we fall back to RoundNearest
return RoundNearest
return RoundingMode{:Exact}()
else
throw(ArgumentError("invalid Arb rounding mode code: $r"))

Check warning on line 46 in src/rounding.jl

View check run for this annotation

Codecov / codecov/patch

src/rounding.jl#L46

Added line #L46 was not covered by tests
end
Expand Down
2 changes: 1 addition & 1 deletion test/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
@test convert(RoundingMode, Arblib.ArbRoundDown) == RoundDown
@test convert(RoundingMode, Arblib.ArbRoundUp) == RoundUp
@test convert(RoundingMode, Arblib.ArbRoundNearest) == RoundNearest
@test convert(RoundingMode, Arblib.ArbRoundExact) == RoundNearest
@test convert(RoundingMode, Arblib.ArbRoundExact) == RoundingMode{:Exact}()
end

0 comments on commit ecebae9

Please sign in to comment.