<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 14 Jan 2013, at 17:03, Martin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; 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; ">On 14/01/2013 15:52, Jonas Maebe wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 14 Jan 2013, at 16:44, Martin wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">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></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">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.</blockquote><br>not sure if I follow. If "or" performs on a "set of bits" (rather than a number)</span></blockquote></div><br><div>It doesn't operate on a set. The left and right operands are whole numbers, and hence the operator works on whole numbers and returns a whole number. In Pascal, sets and whole numbers are completely distinct types with different operators. There is no magic type conversion from integer to a set and back just because you use the "or" operator.</div><div><br></div><div><br></div><div>Jonas</div></body></html>