metaeducation / rebol-issues

6 stars 1 forks source link

MAKE BITSET! with integer argument specifies highest index, not length #949

Open rebolbot opened 15 years ago

rebolbot commented 15 years ago

Submitted by: meijeru

Because bitsets have 0-based origin for their index, their length is at least one more than the highest index (it is rounded up to a multiple of 8), and apparently the integer argument is interpreted as this index; with the rounding-up, it is true that the other interpretation as length would also give problems (make bitset! 33 => will end up as 40 ?!?)

>> length? make bitset! 256
== 264 ; gotcha
>> length? make bitset! 255
== 256 ; numbered 0 .. 255

CC - Data [ Version: alpha 57 Type: Issue Platform: All Category: Datatype Reproduce: Always Fixed-in:alpha 72 ]

rebolbot commented 15 years ago

Submitted by: BrianH

Sounds good to me :)