Skip to content

Commit 8c3e1d9

Browse files
committed
Fix convert to Integer at the input limits
Actually, the original code should always work given that `isinteger` doesn't have overflow problems. I updated the code to match the rest of the recent changes but unfortunately it appears impossible to test.
1 parent 9a5acef commit 8c3e1d9

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
@@ -250,7 +250,7 @@ end
250250

251251
function convert{TI <: Integer, T, f}(::Type{TI}, x::FD{T, f})::TI
252252
isinteger(x) || throw(InexactError())
253-
div(x.i, T(10)^f)
253+
div(x.i, coefficient(FD{T, f}))
254254
end
255255

256256
convert{TR<:Rational,T,f}(::Type{TR}, x::FD{T, f})::TR =

0 commit comments

Comments
 (0)