We often need to compare two floating point numbers a and b in Rust, which can be done using a.partial_cmp(b).unwrap(). This panics as soon numbers like NaN are involved. We should investigate whether we can avoid them using Errors (instead panics) when creating certain objects.
We often need to compare two floating point numbers
a
andb
in Rust, which can be done usinga.partial_cmp(b).unwrap()
. This panics as soon numbers likeNaN
are involved. We should investigate whether we can avoid them using Errors (instead panics) when creating certain objects.