# computing determinants in MATLAB, round-off errors

I am experiencing a computational problem in MATLAB.

I have a $p \times p$ matrix $A$ whose true value of the determinant is a very large positive number due to the construction of the matrix. However MATLAB gives a large negative value for the determinant of $A$. I introduced some computational techniques to prevent round-off errors by dividing each element in $A$ by a positive constant $c$ and subsequently multiplying the result of $\det(A./c)$ by $c^p$.

If $c=2$, the value I obtain is still negative while if $c=5$ or $c=10$ I get a positive value. Anyone knows why or maybe does anyone have any insight how to go about this problem?

• I trust that you considered whether you actually need the determinant of said matrix... Also, since this is a numerical question, why not post the matrix with actual numbers here? Otherwise the question looks like an invitation for everyone to guess the reasons for matlab's behavior. – user53153 Feb 20 '13 at 7:15
• Perhaps this is a duplicate? stackoverflow.com/questions/4344476/… – Dennis Jaheruddin Feb 22 '13 at 17:01