The determinant of a triangular matrix is equal to the product of its diagonal entries. Use this fact to develop a routine for computing the determinant of an arbitrary nn matrix $A$ by using its $LU$ factorization. You may use a library routine for Gaussian elimination with partial pivoting to obtain the $LU$ factorization, or you may design your own routine. How can you determine the proper sign for the determinant? To avoid risk of overflow or underflow, you may wish to consider computing the logarithm of the determinant instead of the actual value of the determinant.
I'm not sure what I'm suppose to do here. I use matlab and do
[L,U] = lu(A) to the get the $LU$ product, but how does the log come into play?