# Should scalar divided by matrix be allowed?

**URL:** <https://discourse.julialang.org/t/should-scalar-divided-by-matrix-be-allowed/23502>\
**Category:** Internals & Design\
**Created:** [April 25, 2019, 10:07am UTC](https://discourse.julialang.org/t/should-scalar-divided-by-matrix-be-allowed/23502 "2019-04-25T10:07:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [April 25, 2019, 11:33am UTC](https://discourse.julialang.org/t/should-scalar-divided-by-matrix-be-allowed/23502/2 "2019-04-25T11:33:24Z")

</div>

> [@bsxfan](#):
>
> My argument in favour of more generally allowing the division of scalars by matrices is therefore one of _consistency_ .

In the name of consistency, instead of extending it, I would suggest removing the pseudoinverse `/` magic for vectors. It is a bad pun, and just causes confusion. Cf

> [@Feature or Bug? - Divide by zeros: 1/0 vs \[1\]/\[0\]](https://discourse.julialang.org/t/feature-or-bug-divide-by-zeros-1-0-vs-1-0/22960):
>
> Before I open an Issue, I would like to discuss this question. The core of the question is the following difference: julia\> 1 / 0 Inf julia\> [1] / [0] 1×1 Array{Float64,2}: 0.0 In my [method](https://github.com/bachrathyd/MDBM.jl) this lead to a problem as discovered [here](https://github.com/bachrathyd/MDBM.jl/issues/16), because I use the left division with a non-square matrix, which can be full of zeros in some special situation. I supposed that as a tends to zero [1]/[a] tends to infinity julia\> [1] / [0.01] 1×1 Array{Float64,2}: 100.0 julia\> [1] / [0.001] 1×1 Array{Float64,2…

Users who want a pseudoinverse should explicitly ask for it.

Also, are you aware of `LinearAlgebra.I`? Eg `(2*I)/randn(3,3)` etc.

---

_[View the full topic](https://discourse.julialang.org/t/should-scalar-divided-by-matrix-be-allowed/23502)._
