I see there is a double.INFINITY but I can't see a way to say "int INFINITY". Which is interesting, because I see I can do some_integer.isInfinite
.
What's a way to say int.INFINITY
in Dart? Does that even make sense?
No. All Dart integers are finite.
You can ask 42.isInfinite
, but the answer is predictably false
. If you check the code of the int
class, you'll like find bool get isInfinite => false;
somewhere.
The reason the getter is there at all is that it's defined on num
, the superclass of int
and double
, and you can do many operation on numbers without knowing whether they are integers or doubles.
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