Double.isInfinite(1.0 / 0.0);
returns true.
Double.isInfinite(1.0 / 3.0);
but this doesnt, and to my understanding this would be an infinite number as this returns 0.33333_ to infinity.
why?
Double.isInfinite
does not return true if the value is infinitely long; it returns true if the value is itself infinite (either positive or negative).
Also, 1.0/3.0 is infinitely long in base 10, but not in other bases, like base 3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With