Re:Operator constraints in Go
by dinosaurdynasty on Monday May 23, 2022 @04:23PM
(#31484367)
Rust handles this in a "correct", if annoying way: the stdlib sort requires its elements to have a "totally ordered" trait, and floating point doesn't have that trait. You have to either give a custom comparison function, or use a "non-NaN and totally orderable floating point" type some non-stdlib crates have.
[ Parent
| on HN ]