Adriaan van Os wrote:
... snip ...
We also have shl and shr and I suggest adding rol and ror (rotate left and rotate right).
If you are going to do that you should have a complete spectrum: asl asr arithmetic shift. (asl = lsl but overflows) lsl lsr logical shift (unsigned) rol ror rotation. (length dependant) The trouble is that many of these require a binary representation of integer operands, and Pascal in general does not require that. Also Pascal does not have the equivalent of a C unsigned type. How do you interpret them on a decimal machine, a 1's complement machine, a sign-magnitude machine? Also with differing values for maxint (which need not be a binary power of 2 in Pascal). You can define the arithmetic shifts in terms of multiply/divide. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson