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)
257
257
258
258
- (x:: TwicePrecision ) = TwicePrecision (- x. hi, - x. lo)
259
259
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
261
264
262
265
# Arithmetic
263
266
Original file line number Diff line number Diff line change 193
193
@test_throws ErrorException (" Int is incommensurate with PhysQuantity" ) x* 2 # not a MethodError for convert
194
194
@test x. hi/ 2 === PhysQuantity {1} (2.0 )
195
195
@test_throws ErrorException (" Int is incommensurate with PhysQuantity" ) x/ 2
196
+ @test zero (typeof (x)) === Base. TwicePrecision (PhysQuantity {1} (0.0 ))
196
197
end
197
198
@testset " ranges" begin
198
199
@test size (10 : 1 : 0 ) == (0 ,)
You can’t perform that action at this time.
0 commit comments