From e3ade762969d2fe3d4091cfb06563371c82fc7a1 Mon Sep 17 00:00:00 2001 From: GregPlowman Date: Fri, 11 Aug 2017 08:59:46 +1000 Subject: [PATCH 1/2] Update definition of < operator --- src/DoubleDouble.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/DoubleDouble.jl b/src/DoubleDouble.jl index 5511147..d3c6915 100644 --- a/src/DoubleDouble.jl +++ b/src/DoubleDouble.jl @@ -102,9 +102,8 @@ Double(x::BigFloat) = convert(Double{Float64}, x) Double(x::Irrational) = convert(Double{Float64}, x) # < - function <{T}(x::Double{T}, y::Double{T}) - x.hi + x.lo < y.hi + y.lo + x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo) end # add12 From e2ae71b3aa4e43e283de94ac1ac68dc1e16ce733 Mon Sep 17 00:00:00 2001 From: GregPlowman Date: Fri, 11 Aug 2017 09:56:36 +1000 Subject: [PATCH 2/2] Test < operator --- test/runtests.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 5158aeb..1e63081 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -41,6 +41,9 @@ bxy = bx*by #@test rem(dxy,1.0) == Double(rem(bxy,1.0)) +let x = Double(big"3.1") + @test Double(x.hi, prevfloat(x.lo)) < x < Double(x.hi, nextfloat(x.lo)) +end ## New @test Double(pi) == Double{Float64}(3.141592653589793, 1.2246467991473532e-16)