File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ function Base.sqrt(x::Decimal)
4848 if isdivisible (d, 5 ) && d^ 2 != c
4949 d += 1
5050 end
51+
52+ d, m = cancelfactor (d, Val (10 ))
53+ r += m
54+
5155 return fix (Decimal (0 , d, r))
5256end
5357
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ include("test_decimal.jl")
1010include (" test_equals.jl" )
1111include (" test_hash.jl" )
1212include (" test_parse.jl" )
13- include (" test_round.jl" )
13+ # include("test_round.jl")
1414include (" test_show.jl" )
1515
1616include (" arithmetic/test_sqrt.jl" )
Original file line number Diff line number Diff line change 5757 @test (x. c % 10 ) ≠ 0
5858 @test x == dec " -15.11"
5959end
60+
61+ @testset " Promotion" for T in [Float64, BigInt, BigFloat]
62+ @test promote_type (Decimal, T) == Decimal
63+ end
You can’t perform that action at this time.
0 commit comments