Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
因为比较这两个数是按照参数的先后顺序的。返回的数是要看第一个参数是小于,等于或大于第二个参数,对应的返回一个负整数,零或正整数。
不同位置返回的数是不同的,结果为相反数。
compare(x,y)=-compare(y,x) |