Hullaballoonatic
11/29/2018, 9:59 PMShawn
11/29/2018, 9:59 PMNumber
is the closest thing to what you’re asking forHullaballoonatic
11/29/2018, 10:00 PMShawn
11/29/2018, 10:01 PMInt
, for example, extends Number
and implements Comparable<Int>
, so I don’t think there’s another intermediate type that does the sameHullaballoonatic
11/29/2018, 10:01 PMRestrictedNumber
delegate(s), starting with RestrictedInt
, and it'd be nice to not have to make a compareTo()
for every number typekarelpeeters
11/29/2018, 10:38 PMHullaballoonatic
11/29/2018, 10:38 PMkarelpeeters
11/29/2018, 10:39 PMHullaballoonatic
11/29/2018, 10:39 PMkarelpeeters
11/29/2018, 10:41 PMFraction: Number
and a BigInteger: Number
, and I add them. Now what? Neither fits into the other. In general there might be tens of Number implementations that then all need to be math-compatible with each other.Hullaballoonatic
11/29/2018, 10:42 PMkarelpeeters
11/29/2018, 10:43 PMHullaballoonatic
11/29/2018, 10:43 PMkarelpeeters
11/29/2018, 10:45 PMfun add(x: Number, y: Number): Number
that makes it work out.Hullaballoonatic
11/29/2018, 10:48 PMkarelpeeters
11/29/2018, 10:48 PMHullaballoonatic
11/29/2018, 10:49 PMkarelpeeters
11/29/2018, 10:49 PMHullaballoonatic
11/29/2018, 10:49 PM