When I input
Sort[{-Sqrt[3],0}]
I get
{0,-Sqrt[3]}
This can't be right, can it?
This result is correct.
Sort
doesn't sort by numerical value. It simply orders expressions—any expression, whether they represent a number of something else.
Use SortBy[..., N]
to sort by numerical value.
See the sorting rules under Details in Sort
. See also Possible Issues on the same page.
Sort
documentation: "Numeric expressions are sorted by structure as well as numerical value" $\endgroup$