Then note on this advice:
I checked and it does widen up to Int128, but then to BigInt, and Float64 to BigFloat. Inherently there’s nothing wrong with going to Int256 or higher (or even just to Int64 before BigInt), it’s just that Julia doesn’t have those types, but a package does up to Int1024 if I recall.
It’s
defined so that arithmetic operations + and - are guaranteed not to overflow nor lose precision for any combination of values that type x can hold.
actually you only need to widen by 1 bit for that, if you had such a type. For a * b
you need a-plus-b-number-of-bits, or double them when same type, what widen does. ^
and <<
are problematic operators.
That’s the short summary of my longer (not, yet, implemented proposal):