Numberick icon indicating copy to clipboard operation
Numberick copied to clipboard

Non-fixed-width `init(repeating:)`

Open oscbyspro opened this issue 2 years ago • 3 comments

I think init(repeating:) should be moved to NBKBinaryInteger so it becomes available to IntXL, and UIntXL could reasonably trap on init(repeating: true). I suppose that adding a duplicate requirement to NBKSignedInteger is an alternative, but I don't find that as elegant.

oscbyspro avatar Jul 31 '23 09:07 oscbyspro

The asymmetry of (#34) is an argument in favor of adding a duplicate requirement to NBKSignedInteger. Hm.

oscbyspro avatar Aug 02 '23 07:08 oscbyspro

I suppose it's unclear what size this would give a manually resizable integer. Hm.

oscbyspro avatar Aug 02 '23 15:08 oscbyspro

An alternative is committing to fixed-width by moving init(bit:) to NBKFixedWidthInteger. The rationale being that heap allocating a single bit is almost never what you intend to do.

oscbyspro avatar Aug 03 '23 13:08 oscbyspro