Closed oscbyspro closed 3 weeks ago
The immediate application is the well-behaved 1-by-1-as-2 BinaryInteger/multiplication(_:)
method.
I had initially imagined that arbitrary unsigned integers would extend forever-and-ever in the same way that signed integers do, but this a greater unification. Innovation is in some ways similar to excavation.
For arbitrary integers to behave like systems integers, the
appendix
bit extension of unsigned integers must end at some point. In particular, it must end at bitCount.infinity
. As such, the proper way of loading the high part ofDoublet<T>
is by repeatingBit(x.isNegative)
rather thanx.appendix
, which is a bit finicky. Something, something, orders of infinity. It might, therefore, make sense to addDoublet.init(load:)
.