Skip to content

Commit f4f9494

Browse files
Use the bigger of the integer types when promoting to Rational
- this should avoid us hitting an `InexactError`
1 parent d1da1db commit f4f9494

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FixedPointDecimals.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ end
328328

329329
Base.promote_rule(::Type{FD{T, f}}, ::Type{<:Integer}) where {T, f} = FD{T, f}
330330
Base.promote_rule(::Type{<:FD}, ::Type{TF}) where {TF <: AbstractFloat} = TF
331-
Base.promote_rule(::Type{<:FD}, ::Type{Rational{TR}}) where {TR} = Rational{TR}
331+
Base.promote_rule(::Type{<:FD{T}}, ::Type{Rational{TR}}) where {T, TR} = Rational{promote_type(T, TR)}
332332

333333
# TODO: decide if these are the right semantics;
334334
# right now we pick the bigger int type and the bigger decimal point

0 commit comments

Comments
 (0)