Calculates the determinant of M of the entered matrix.