oscbyspro / AwesomeNumbersKit

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

Replace `ANKSign` and demote `ANKSigned` to `ANKSignedKit` #129

Closed oscbyspro closed 1 year ago

oscbyspro commented 1 year ago

I think AKNSign can easily be replaced by Swift.FloatingPointSign (or even Bool). The only commonly used operation is xor which maps to !=. ANKSigned is neat, on the other hand, but I think it belongs in ANKSignedKit (unsurprisingly). What I still have to decide is whether ANKFixedWidthInteger needs init methods like exactly(sign:magnitude:) outside of ANKSignedKit.

oscbyspro commented 1 year ago

Also, init(exactly: ANKSigned<Magnitude>) and init(clamping: ANKSigned<Magnitude>) should be enough.

oscbyspro commented 1 year ago

Hm. FloatingPointSign is RawRepresentable so AND, OR and XOR are canon.