Re: Set limitations
Martin Frb via fpc-pascal <[email protected]>
| Newsgroups | gmane.comp.compilers.free-pascal.general |
|---|---|
| Message-ID | <[email protected]> |
On 11/01/2025 14:57, Hairy Pixels via fpc-pascal wrote: > On Jan 11, 2025 at 8:17:33 PM, Hairy Pixels <[email protected]> wrote: >> I was curious, is there any practical limit on the size of a set (32 >> bits and 256 values) and why they couldn’t be 64 bit or any other >> arbitrary size? The floor seems to be 4 bytes too but why not allow >> smaller sizes to save memory? Perhaps just a historical artifact but >> I was curious. > > Sorry that was wrong, the biggest size is 32 bytes and the largest > size of an enum is 256 elements. I was talking about sets of enums > also if that wasn’t clear. > > I still don’t see it’s possible to make a set which is smaller than 4 > bytes, even in the 0..7 range. > program Project1; {$PackSet 1} var a: set of byte; b: set of 0..7; begin writeln(sizeof(a)); writeln(sizeof(b)); readln; end. _______________________________________________ fpc-pascal maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal