Return generic to its discrete type
I run a bunch of calculations using Decimal and Double. Without generics there’d be a lot of repetitive code. There are places I eventually need the Decimal in a more native format but I can’t seem to figure out how to do that in Swift.
Swift generic Decimal divide operator missing
I was trying to come up with some code using generics to switch between Double and Decimal and setup this simple example using all the “Conforms To” relationships in Decimal which is a subset of the relationships listed in Double: