# Checking for singularity of matrix

**URL:** <https://discourse.julialang.org/t/checking-for-singularity-of-matrix/54746>\
**Category:** General Usage\
**Created:** [February 6, 2021, 6:08pm UTC](https://discourse.julialang.org/t/checking-for-singularity-of-matrix/54746 "2021-02-06T18:08:06Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 26, 2022, 10:09pm UTC](https://discourse.julialang.org/t/checking-for-singularity-of-matrix/54746/4 "2022-12-26T22:09:49Z")

</div>

> [@iamsuddhasattwa](#):
>
> is there a way to check for singularity of `A` ?

Numerically, this question is a bit ill-defined, because roundoff errors make it hard to distinguish between a matrix that is _exactly_ singular and a matrix that is [_nearly_ singular](https://mathworld.wolfram.com/Ill-ConditionedMatrix.html). Moreover, as a practical matter it is rarely a good idea to try to make this distinction — matrices that are _nearly_ singular are in many ways just as “bad” as matrices that are singular.

If you find yourself solving a lot of systems that are nearly singular, that it is a good sign that you need to re-think what you are doing. (e.g. perhaps you need some regularization in your equations)

Where are these matrices coming from? Why are they sometimes singular or nearly so?

---

_[View the full topic](https://discourse.julialang.org/t/checking-for-singularity-of-matrix/54746)._
