I am new to Dart and I can see Dart has num
which is the superclass of int
and double
(and only those two, since it's a compile time error to subclass num
to anything else).
So far I can't see any benefits of using num
instead of int
or double
, are there any cases where num
is better or even recommended? Or is it just to avoid thinking about the type of the number so the compiler will decide if the number is an int
or a double
for us?