<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 11/01/2025 14:57, Hairy Pixels via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGsUGtmWLCGRsUDC0B8avOSCSbwPxSki3uTB-DFmO9kzgauq0g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Jan 11, 2025 at 8:17:33 PM,
Hairy Pixels <<a href="mailto:genericptr@gmail.com"
moz-do-not-send="true" class="moz-txt-link-freetext">genericptr@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"
type="cite"> 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.<br>
</blockquote>
</div>
<br>
<div dir="ltr">Sorry that was wrong, the biggest size is <span
style="color:rgb(14,14,14)">32 bytes and the largest size of
an enum is </span><span style="color:rgb(14,14,14)">256</span><font
color="#0e0e0e"> elements. I was talking about sets of enums
also if that wasn<span style="caret-color: rgb(14, 14, 14);">’</span>t
clear.</font></div>
<div dir="ltr"><font color="#0e0e0e"><br>
</font></div>
<div dir="ltr"><font color="#0e0e0e">I still don’t see it’s
possible to make a set which is smaller than 4 bytes, even in
the 0..7 range.</font></div>
<br>
</blockquote>
<br>
program Project1;<br>
{$PackSet 1}<br>
var<br>
a: set of byte;<br>
b: set of 0..7;<br>
begin<br>
writeln(sizeof(a));<br>
writeln(sizeof(b));<br>
readln;<br>
end.<br>
<br>
</body>
</html>