# Scalar divided by range or array

**URL:** <https://discourse.julialang.org/t/scalar-divided-by-range-or-array/8196>\
**Category:** General Usage\
**Tags:** question, bug, array\
**Created:** [January 6, 2018, 10:41am UTC](https://discourse.julialang.org/t/scalar-divided-by-range-or-array/8196 "2018-01-06T10:41:15Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [January 6, 2018, 4:39pm UTC](https://discourse.julialang.org/t/scalar-divided-by-range-or-array/8196/6 "2018-01-06T16:39:49Z")

</div>

> [@Tamas\_Papp](#):
>
> OTOH this looks like something that can be invoked accidentally very easily (eg missing a . in ./, etc). It may be surprising to new users of the language who don’t expect this.

Exactly!

I can see this might be a logical consequence of treating scalars and 1x1 matrices as equivalents though. For example, when one wants to solve the system x^TA=b where A happens to be a single column vector (matrix) and b is therefore in this shady area of being a 1x1 matrix in some contexts and a scalar in others. In that case, right “dividing” by A on both sides might be a mathematically elegant way to get the solution for x. So there seems to be some rationale behind it but it’s rather subtle at first sight. Obviously, 1 element vectors are also in the same shady club.

---

_[View the full topic](https://discourse.julialang.org/t/scalar-divided-by-range-or-array/8196)._
