# Solving A\*x=b in Nemo

**URL:** <https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051>\
**Category:** General Usage\
**Tags:** matrices, convert, nemo\
**Created:** [July 1, 2023, 1:04pm UTC](https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051 "2023-07-01T13:04:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [July 1, 2023, 8:45pm UTC](https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051/3 "2023-07-01T20:45:04Z")

</div>

> [@greatpet](#):
>
> If you were doing this over floating-point numbers, it makes sense to talk about a “closest” solution, but this is not a natural thing for rational numbers or integers. If you really need to do this, convert the matrix and vector to Float64.

You’re assuming @blociss wants the closest solution, however what they want is not at all clear.

@blociss if you’re looking for an exact solution, as opposed to the closest one, look here:

> [@How to exactly solve large overdetermined systems of linear equations](https://discourse.julialang.org/t/how-to-exactly-solve-large-overdetermined-systems-of-linear-equations/86710/):
>
> Suppose I have, e.g., 250 linear equations with Rational{BigInt} coefficients, with 150 variables. If the system is inconsistent I want to know about it, otherwise I want the exact solution. Is there an easier way than writing my own Gaussian elimination? This won’t run often, so I’m not concerned with long runtimes.

---

_[View the full topic](https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051)._
