Bit rotation question/challenge

Afgdr zerzre.rertert at gmx.com
Sat Jan 30 15:39:22 UTC 2021


On Saturday, 30 January 2021 at 14:56:14 UTC, burt wrote:
> On Saturday, 30 January 2021 at 14:41:59 UTC, Afgdr wrote:
>> On Saturday, 30 January 2021 at 14:40:49 UTC, Afgdr wrote:
>>> On Saturday, 30 January 2021 at 13:30:49 UTC, burt wrote:
>>>> [...]
>>>
>>> cast as uint and shift. cast the result as ubyte[4].
>>
>> obiously, that works for n=4 with uint and n=8 for ulong, only.
>
> Yes I used to do this, but then I needed it for n > 8.

As suggested in the other answer BitArray may be the best generic 
solution.


More information about the Digitalmars-d-learn mailing list