No, it doesn't. It has the exact same rounding bug described in the article.
The article even mentions:
> FWIW, all 22 answers posted, including the ones using Apache Commons and Android libraries, had this bug (or a variation of it) at the time of writing.
Diggsey|6 years ago
The article even mentions:
> FWIW, all 22 answers posted, including the ones using Apache Commons and Android libraries, had this bug (or a variation of it) at the time of writing.
jandrese|6 years ago
999,999 shouldn't be big enough to be affected by floating point rounding.
If the comment is correct then Java will evaluate ( 999999 >= 1000000 ) as true, which simply cannot be correct.
Ragib_Zaman|6 years ago
Recursing|6 years ago
That's actually not true (as somebody mentioned on reddit) https://github.com/openjdk-mirror/jdk/blob/jdk8u/jdk8u/maste...
It is probably slower anyway, but I was surprised to see no loops
JacksCracked|6 years ago
[deleted]