flint
flint copied to clipboard
a more reasonable sorting of complex numbers
In the current sorting, we have z < conjugate(z)
and conjugate(z) < z
.
I propose sorting on the real part; if they overlap, use the imaginary part.
Note that in the library, _acb_vec_sort_pretty
is used to sort polynomials' roots, which are multisets of non-overlapping balls.
Therefore, we will obtain a predictable and stable sorting with the new comparison function.
PS: this will break some tests at Sagemath, as the roots will now come in a different order, but this is how I got into this rabbit hole.