Comment

Comment by cuteboy19

This is true for all languages, not just Python.

Unfortunately C++ STL does not offer anything close to isclose (boost does however). Neither does Java. Float.compare is just == in disguise.

But while going through the docs I stumbled upon this Gem

> If f1 and f2 both represent Float.NaN, then the equals method returns true, even though Float.NaN==Float.NaN has the value false.

https://docs.oracle.com/javase/7/docs/api/java/lang/Float.ht...

parent cuteboy19 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton