oscbyspro / Ultimathnum

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

Binary integer description interoperability #132

Closed oscbyspro closed 1 week ago

oscbyspro commented 1 week ago

The current binary integer description format matches this regular expression:

let regex: Regex = #/^(\+|-)?(#|&)?([0-9A-Za-z]+)$/#

I initially added the (#|&)? part as a stop-gap measure to allow infinite binary integer magnitudes. It has worked out so far, but I now realize that the ("#") character makes finite integer decoding unusually lenient. It would be better if the infinite binary integer stuff were only allowed in the context of infinite binary integers. Removing ("#") from the format seems like the most appropriate solution.