File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,10 @@ big(x::TwicePrecision) = big(x.hi) + big(x.lo)
257257
258258- (x:: TwicePrecision ) = TwicePrecision (- x. hi, - x. lo)
259259
260- zero (:: Type{TwicePrecision{T}} ) where {T} = TwicePrecision {T} (0 , 0 )
260+ function zero (:: Type{TwicePrecision{T}} ) where {T}
261+ z = zero (T)
262+ TwicePrecision {T} (z, z)
263+ end
261264
262265# Arithmetic
263266
Original file line number Diff line number Diff line change 193193 @test_throws ErrorException (" Int is incommensurate with PhysQuantity" ) x* 2 # not a MethodError for convert
194194 @test x. hi/ 2 === PhysQuantity {1} (2.0 )
195195 @test_throws ErrorException (" Int is incommensurate with PhysQuantity" ) x/ 2
196+ @test zero (typeof (x)) === Base. TwicePrecision (PhysQuantity {1} (0.0 ))
196197end
197198@testset " ranges" begin
198199 @test size (10 : 1 : 0 ) == (0 ,)
You can’t perform that action at this time.
0 commit comments