# Bug with divrem?

**URL:** <https://discourse.julialang.org/t/bug-with-divrem/3976>\
**Category:** General Usage\
**Tags:** debug\
**Created:** [May 29, 2017, 1:50pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976 "2017-05-29T13:50:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexhallam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexhallam/32/435_2.png) [@alexhallam](https://discourse.julialang.org/u/alexhallam)\
**Post date:** [May 29, 2017, 1:50pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/1 "2017-05-29T13:50:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [May 29, 2017, 2:16pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/2 "2017-05-29T14:16:06Z")

</div>

`divrem` calls `div` and `rem` [internally](https://github.com/JuliaLang/julia/blob/96e430199b7104134e79a0daffe6c97caca84c90/base/number.jl#L64). Calling the dot version of `divrem` suppresses the warning: `divrem.(A, B)`.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 29, 2017, 2:16pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/3 "2017-05-29T14:16:59Z")

</div>

It gives different answer though, `Vector` of `Tuple`s intead of `Tuple` of `Vector`’s.

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [May 29, 2017, 2:20pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/4 "2017-05-29T14:20:21Z")

</div>

Why should it be `Tuple` of `Vector`’s?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 29, 2017, 2:20pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/5 "2017-05-29T14:20:36Z")

</div>

The original function gave that.

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [May 29, 2017, 2:33pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/6 "2017-05-29T14:33:04Z")

</div>

By the way, would it be possible to have `divrem` call the related LLVM routine if this exists?

---

<div class="post-metadata">

**Author:** ![alexhallam](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexhallam/32/435_2.png) [@alexhallam](https://discourse.julialang.org/u/alexhallam)\
**Post date:** [May 29, 2017, 3:26pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/7 "2017-05-29T15:26:28Z")

</div>

Is this a bug worth opening an issue for on Julia’s github?

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [May 29, 2017, 4:50pm UTC](https://discourse.julialang.org/t/bug-with-divrem/3976/8 "2017-05-29T16:50:28Z")

</div>

If you would like to file one, go ahead.
