code: public int rank () {
  		double eps = Math.pow(2.0,-52.0);
  		double tol = Math.max(m,n)*s[0]*eps;
  		int r = 0;
  		for (int i = 0; i < s.length; i++) {
  			if (s[i] > tol) {
  				r++;
  			}
  		}
  		return r;
  	}
docs: Effective numerical matrix rank
  @return     Number of nonnegligible singular values.