This is based off of my post on discourse this morning:
I am using
divrem(A, B)
and getting the following warning
WARNING: div(A::AbstractArray, B::Number) is deprecated, use div.(A, B) instead.
It looks like I am being told to use div. instead of div, but I am not using div and I don't think that divrem. exists. Is this warning spurious?
julia> versioninfo()
Julia Version 0.6.0-pre.beta.21
Commit c9ad00a85e (2017-04-04 16:31 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
FWIW, divrem. does exist......
The behavior of divrem is not directly expressible with broadcast so the divrem should probably be fixed...
I'm unclear on what the issue is here, aside from that the deprecation warning is confusing:
julia> divrem.([13,14,15], 7)
3-element Array{Tuple{Int64,Int64},1}:
(1, 6)
(2, 0)
(2, 1)
That's not the result divrem would return.
Ah, yes. I would think the current behavior of divrem should be expressed as unzip(divrem.([13,14,15], 7)), but of course, #13942 is still an open issue.
I think the fix here is to change the divrem(x, y) fallback to divrem(x::Number, y::Number). That will prevent arguments not supported by div (arrays in this case) from leaking through.
Most helpful comment
That's not the result
divremwould return.