Abstract:This paper presents a algorithm for distinguishing a real symmetric matrix into a positive definite, positive semidefinite, negative definite ,negative semidefinite or non-definite matrix. With the technique of selecting maximum diagonal element,the stability of numerical computation for the algorithm is good. The operation numbers of the algorithm is given and the total number of operations of multiplication or division and addition or subtraction of the algorithm are, respectively,at most 1/6 n (n-1)(n+4) and 1/6 n (n-1)(n+1). The numerical examples are given.