Skip to content

Commit

Permalink
Explicitely qualify extended constructors (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Feb 11, 2025
1 parent 1fb0958 commit d543cbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DecFP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,9 @@ for (f) in (:trunc, :floor, :ceil)
end
end

Signed(x::DecimalFloatingPoint) = Int(x)
Unsigned(x::DecimalFloatingPoint) = UInt(x)
Integer(x::DecimalFloatingPoint) = Int(x)
Base.Signed(x::DecimalFloatingPoint) = Int(x)
Base.Unsigned(x::DecimalFloatingPoint) = UInt(x)
Base.Integer(x::DecimalFloatingPoint) = Int(x)

function (::Type{I})(x::DecimalFloatingPoint) where {I<:Integer}
x != trunc(x) && throw(InexactError(:convert, I, x))
Expand Down

0 comments on commit d543cbe

Please sign in to comment.