<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 14/01/2013 15:52, Jonas Maebe wrote:<br>
</div>
<blockquote
cite="mid:0878EAC6-A42E-431E-A39C-6C81EDCF967D@elis.ugent.be"
type="cite"><br>
<div>
<div>On 14 Jan 2013, at 16:44, Martin wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite"><span class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0);
font-family: Monaco; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: 2; text-align: -webkit-auto;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px;
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width:
0px; font-size: medium; "><span class="Apple-style-span"
style="font-family: monospace; ">This is casting a "set of
bits" (neither signed, nor unsigned - a set is not a
number at all) into a number. This only needs to have a
definition, if it should cast to signed or unsigned type.<br>
</span></span></blockquote>
</div>
<br>
<div>It has to be signed, because otherwise any negative number in
the operation would trigger a range check error when it gets
converted to a (larger) unsigned type. The nature of the
operation that is used afterwards is irrelevant, range checking
always operates in exactly the same way when performing a type
conversion from one type to another. This is required to have
predictable behaviour in a programming language.</div>
<div><br>
</div>
</blockquote>
<br>
not sure if I follow. If "or" performs on a "set of bits" (rather
than a number), and a set (not being a number) is neither signed or
unsigned, then before the "OR" both operands (independent of being
signed or not) will be cast to a set. The result is a set. The set
can be converted to either signed or unsigned. The set has no range
checking.<br>
<br>
result := bit_set32(a) or bit_set32(b)<br>
<br>
If result has also 32 (or more) bits, then no range check error can
occur. In the set, the high-bit has no meaning. It is neither part
of the (unsigned positive) numer, nor is it sign indicator. This
meaning is only applied by casting it to a numeric type.<br>
<br>
Same as<br>
var i: set of (b0, b1, b2 .... b31);<br>
signed := integer(i);<br>
unsigned := cardinal(i);<br>
<br>
<br>
</body>
</html>