Q:

Sorting and keeping the main format of list numbers

I have a list with these elements:
list={1/2 (1 + Sqrt[5]), 1, 1, 1/2 (1 - Sqrt[5]), 0};

I want to sort them with
Sort[list];

I see the bellow result:

Which is incorrect, because N[1/2 (1 - Sqrt[5])]= -0.6, However I can write Sort[N[list]] but I need to have the exact numbers, not their approximate values (I mean that I need 1/2 (1 - Sqrt[5]) instead of -0.6).

A:

Look at the Possible Issues section of the documentation for Sort: "Numeric expressions are sorted by structure as well as numerical value"
list = {1/2 (1 + Sqrt[5]), 1, 1, 1/2 (1 - Sqrt[5]), 0};

The approach recommended there to Sort by numerical value only is
sorted = Sort[list, Less]

(*  {(1/2)*(1 - Sqrt[5]), 0, 1, 1, 
   (1/2)*(1 + Sqrt[5])}  *)

Verifying numeric order
% // N

(*  {-0.618034, 0., 1., 1., 1.61803}  *)

Or equivalently,
sorted === Sort[list, #1 < #2 &]

(*  True  *)

Or use SortBy
sorted === SortBy[list, N]

(*  True  *)

A:

Not a bug. The docs: "Sort usually orders expressions by putting shorter ones first, and then comparing parts in a depth‐first manner."
You want SortBy[list,N], I think. For more complex cases, use Ordering[] to get a list of indexes and use that to reorder the original list:
Ordering@N@list
list[[%]]

Perhaps you should consider the option of handing Sort[] your own ordering predicate. Just use any pure function whatsoever which works on #1 and #2 and returns True if #1 comes before #2 in your desired sort order, or False otherwise:
peopleAndAges={{"Felix",50},{"Max",19},{"Sophie",22}};
CompareByName[{n1_String,_},{n2_String}]:=(ToLowerCase@n1 <= ToLowerCase@n2)
CompareByAge[{_,a1_},{_,a2_}]:=(a1 >= a2)

Sort[peopleAndAges,CompareByAge]

