Skip to content

Commit 3a1be85

Browse files
committed
Remove Base.convert(::Type{Decimal}, ::Real)
The method is unnecessary. We define constructors from `Real`s, which is enough for the fallback `convert` method to work. This commit also removes a useless test file.
1 parent 1a4e538 commit 3a1be85

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

src/conversion.jl

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ function Decimal(x::AbstractFloat)
2424
return Decimal(s, c, q)
2525
end
2626

27-
Base.convert(::Type{Decimal}, x::Real) = Decimal(x)
28-
2927
function Base.BigFloat(x::Decimal)
3028
y = BigFloat(x.c)
3129
if x.q 0

test/runtests.jl

-10
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,8 @@ using Test
33

44
@testset "Decimals" begin
55

6-
global d = [
7-
Decimal(false, 2, -1)
8-
Decimal(false, 1, -1)
9-
Decimal(false, 100, -4)
10-
Decimal(false, 1512, -2)
11-
Decimal(true, 3, -2)
12-
Decimal(true, 4, -6)
13-
]
14-
156
include("test_arithmetic.jl")
167
include("test_bigint.jl")
17-
include("test_constructor.jl")
188
include("test_context.jl")
199
include("test_decimal.jl")
2010
include("test_equals.jl")

test/test_constructor.jl

-8
This file was deleted.

0 commit comments

Comments
 (0)