Bob Evans found in the application FixNum # sort does not use the <=> Operator, the code is as follows: Class fixNum @@ count = 0 alias originalcomparator <=> DEF <=> (o) @@ count = 1 Originalcomparator (o) End Def fixnum.count @@ count End end running against it:> array = [5, 4, 3, 2, 1] => [5, 4, 3, 2, 1]> array.sort => [1, 2, 3, 4, 5]> Integer.count => 0 Expected => 6> Result> 0 is actually the case, this can be seen from the source code of Ruby: $ cd / v / build / ruby / ruby- 1.8.1-2004.05.02 / $ less array.c static int sort_2 (ap, bp) ... IF (fixnum_p (a) && fixnum_p (b)) {if (a> b) Return 1; IF (a < b) RETURN -1; RETURN 0;} IF (Type (a) == t_string && type (b) == t_string) {RETURN RB_STR_CMP (A, B);} ... static value sort_internal (ary) value ary; {QSort (ARY) -> PTR, RARRY (ARY) -, RB_BLOCK_GIVEN_P ()? sort_1: sort_2); return ary;} Visit, Ruby does not use <=>, and most General>,