-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Open
Labels
33 - QuestionQuestion about NumPy usage or developmentQuestion about NumPy usage or development
Description
There is a IEEE totalOrder predicate (IEEE 754-2008) that defines the sort order for IEEE floats. Rust implements it as total_cmp
, C++20 implements it as std::strong_order
. It is what you might expect, positive floats (sign bit == 0) are ordered as integers, negative floats (sign bit == 1) as negative integers. The effect is -0 sorts before +0 and positive nans to the end, negative nans to the beginning. NumPy sorts don't follow that convention, so I wonder if we should define a npy_totalOrder
predicate somewhere. Maybe try to have a totalOrder predicate as a scientific python standard. I note that total_cmp
looks like a slightly modified <
and doesn't seem to offer any speed advantage.
Metadata
Metadata
Assignees
Labels
33 - QuestionQuestion about NumPy usage or developmentQuestion about NumPy usage or development