<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: 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: 0; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><span class="Apple-style-span" style="font-size: medium;"><font class="Apple-style-span" color="#0000FF" face="'Gill Sans'">I think what you are advocating is Rodney's proposal + assignability of INTEGER and LONGINT + mixed arithmetic.</font></span></div></span></span></span></span></span></span></span></span></div></span></span>
</div>
<br><div><div>On 8 Jan 2010, at 18:05, <a href="mailto:hendrik@topoi.pooq.com">hendrik@topoi.pooq.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Fri, Jan 08, 2010 at 01:50:28PM -0800, Mika Nystrom wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">Hendrik, do you mean:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">"INTEGER is that subrange of LONGINT that happens to be efficiently <br></blockquote><blockquote type="cite">implementable on the target architecture"?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Why choose a specific size (e.g., 64 bits) for LONGINT, then? Can I<br></blockquote><blockquote type="cite">choose it as I please when I configure/compile the compiler?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> Mika<br></blockquote><br>I've just been thinking of that. Why even have a size for LONGINT? Why <br>not allow the programmer to use only subranges of LONGINT? The <br>arithmetic operations all have the property that you can compute <br>subranges for the reults given subranges for the operands. So <br>intermediate results are all bounded in size, you can compute without <br>overflow happening ... until you get to narrow the final result for <br>assignment to whatever variable you want to <br>assign it to.<br><br>I suspect there are compiler optimisations (well, let's ne honest, <br>call them ameliorations) that could be performed to move the final <br>range-truncate-check backward through the series of operations and limit <br>the number of unnecessary bits that have been computed. These <br>ameliorations are likely to be more effective if no range check need be <br>performed on final assignment (but there's always a conflict between <br>amelioration and run-time checks, isn't there?)<br><br>We could do this for LONGINT completely independent of whatever we do <br>with INTEGER. INTEGER doesn't need to be a subrange of LONGINT. <br>INTEGER is what you use when you particularly want to use <br>machine-efficient data and operations. LONGINT is what you use when <br>that's not enough, and you want to statically specify the size of <br>integer you need, and pay the price. What with machines having carry <br>and overflow flags, add-with-carry instructions, it chould be possible <br>to generate reasonably efficient code anyway, without the full overhead <br>of run-time-determined number sizes.<br><br>Most machines already have integer multiply instructions that return a <br>double-length product. It's such a pity to waste them.<br><br>-- hendrik<br></div></blockquote></div><br></body></html>