Converting from one integer type to another is performed using the concept of the ‘maximum width integer’ (see
MaxInt
),which is an artificial limitation. The very existence ofMaxInt
makes it unclear what to do should someone implementInt256
,for example.
The proposed model eliminates the ‘largest integer type’ concept prevIoUsly used to interoperate between integer types (see
toIntMax
in the current model) and instead provides access to machine words. It also introduces themultipliedFullWidth(by:)
,dividingFullWidth(_:)
,andquotientAndRemainder
methods. Together these changes can be used to provide an efficient implementation of bignums that would be hard to achieve otherwise.
在这种特定情况下,FB SDK应该只使用UInt64($ 0)初始化程序,由于新协议,它现在可用于任何BinaryInteger类型。