Make nan types sort to the end, fixes #282.

This fixes #282. It's equivalent to what numpy did in numpy/numpy@717c7acf14d04be79d7a1c098d83cac69481e0af. One day we will refactor all this code (perhaps in cython as in #301) but for the moment this does the job.

Should I add test cases for all Float atoms?