Skip to content

Commit

Permalink
improve deprecation warning for non-integer indexing: suggest replaci…
Browse files Browse the repository at this point in the history
…ng i/j with i÷j (see JuliaLang#10458)
  • Loading branch information
stevengj committed Nov 19, 2015
1 parent ea2ab73 commit 8a94e6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ end
to_index_nodep(i::Real) = convert(Int,i)::Int

@noinline function to_index(i::Real)
depwarn("indexing with non Integer Reals is deprecated", :to_index)
depwarn("Indexing with non-Integer Reals is deprecated. It may be that your index arose from an integer division of the form i/j, in which case you should consider using i÷j or div(i,j) instead, equivalent to round(Int, i/j, RoundToZero).", :to_index)
to_index_nodep(i)
end

Expand Down

0 comments on commit 8a94e6a

Please sign in to comment.