'Is there a useful "number-like" generic constraint in Kotlin?
I'm writing a matrix and a vector class, and I'd like to make it usable with all "sensible" numerical data types, not only for the BigFraction data type I wrote myself for my current purpose.
Therefore, I'm wondering whether there is an interface which requires + and * to be implemented (or perhaps even more operator functions).
Thus, I'd like to have a useful generic constraint.
Thanks a lot in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|