oscbyspro / AwesomeNumbersKit

Large number arithmetic in Swift
Apache License 2.0
7 stars 1 forks source link

Galaxy brain `multipliedReportingOverflow(by:)` #122

Closed oscbyspro closed 1 year ago

oscbyspro commented 1 year ago

From https://github.com/oscbyspro/Numberick/issues/6

It turns out that multipliedReportingOverflow(by:) can be written simply and efficiently with the overflow indicator returned by formTwosComplementSubsequence(true). I recently realized that you can use it to check if unsigned integers equal zero, and if signed integers equal their minimum representable value. [...].

oscbyspro commented 1 year ago

This requires formTwosComplementSubsequence(_:) (#121).