From ecebae9df22345c2e22d2bab167ab4091122a6ed Mon Sep 17 00:00:00 2001 From: Joel Dahne Date: Tue, 6 Feb 2024 08:59:56 +0100 Subject: [PATCH] convert ArbRoundExact to RoundingMode{:Exact} instead of RoundNearest --- src/rounding.jl | 3 +-- test/rounding.jl | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rounding.jl b/src/rounding.jl index fa6de69..303312e 100644 --- a/src/rounding.jl +++ b/src/rounding.jl @@ -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")) end diff --git a/test/rounding.jl b/test/rounding.jl index a4c271a..9370e65 100644 --- a/test/rounding.jl +++ b/test/rounding.jl @@ -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