# Matrix multiplied by inverse matrix does not reproduce identity matrix

**URL:** <https://discourse.julialang.org/t/matrix-multiplied-by-inverse-matrix-does-not-reproduce-identity-matrix/65706>\
**Category:** General Usage\
**Tags:** linearalgebra, inverse\
**Created:** [August 3, 2021, 12:14am UTC](https://discourse.julialang.org/t/matrix-multiplied-by-inverse-matrix-does-not-reproduce-identity-matrix/65706 "2021-08-03T00:14:17Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [August 3, 2021, 2:36am UTC](https://discourse.julialang.org/t/matrix-multiplied-by-inverse-matrix-does-not-reproduce-identity-matrix/65706/4 "2021-08-03T02:36:49Z")

</div>

It’s _nearly_ symmetric. Because of the [imprecision inherent in floating point numbers](https://discourse.julialang.org/t/psa-floating-point-arithmetic/8678), it’s best to use approximate comparisons like this:

```julia
julia> varc ≈ varc'
true

```

The approximate equality symbol can be typed in the REPL with `\approx<TAB>`, or you can use the equivalent function call: `isapprox(varc, varc')`. If you know your matrix is structurally symmetric, you can use the `Symmetric` wrapper type:

```julia
julia> Symmetric(varc)
4×4 Symmetric{Float64, Matrix{Float64}}:
  1.1275 -0.0000 -0.0000 -0.0000
 -0.0000 -0.0000 -0.0000 -0.0000
 -0.0000 -0.0000 -0.0000 -0.0000
 -0.0000 -0.0000 -0.0000 -0.0000

julia> issymmetric(ans)
true

```

---

_[View the full topic](https://discourse.julialang.org/t/matrix-multiplied-by-inverse-matrix-does-not-reproduce-identity-matrix/65706)._
