# Possible bug in determinant calculation

**URL:** https://discourse.julialang.org/t/possible-bug-in-determinant-calculation/20323
**Category:** Numerics
**Created:** [January 31, 2019, 4:19pm UTC](https://discourse.julialang.org/t/possible-bug-in-determinant-calculation/20323 "2019-01-31T16:19:23Z")
**Posts on this page:** 1
**Showing post:** 8

<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: [February 5, 2019, 11:32pm UTC](https://discourse.julialang.org/t/possible-bug-in-determinant-calculation/20323/8 "2019-02-05T23:32:01Z")

</div>

> [@scheinerman](#):
>
> I’d like to make a request that `det` returns a number that has the same type as the entries in the matrix. So if the matrix is populated by `Int` s then the determinant should also be an `Int` .

You can do this without overflowing by using `Rational{BigInt}`, although this can get expensive quickly. I don’t think it should use `BigInt` unless you explicitly request this.

There are specialized algorithms for integer determinants (e.g. [Dodgeson condensation](https://en.wikipedia.org/wiki/Dodgson_condensation)), but in general doing computational number theory efficiently is probably outside the scope of the standard LinearAlgebra library and is more something for packages like Nemo.jl.

---

_[View the full topic](https://discourse.julialang.org/t/possible-bug-in-determinant-calculation/20323)._
