oscbyspro / Ultimathnum

Binary arithmetic reimagined in Swift
Apache License 2.0
4 stars 1 forks source link

Non-allocating binary integer validation #22

Closed oscbyspro closed 2 weeks ago

oscbyspro commented 2 weeks ago

I noticed that I ought to have a non-allocating binary integer validation algorithm while working on (#21). The failing bit pattern of BinaryInteger.exactly(_:) is immediately discarded in init(clamping:), so it would be better to use something like BinaryInteger.validate(_:).

Edit: I suppose I don't actually have to use BinaryInteger.exactly(_:) in init(clamping:).