Lennart Thelander wrote:
I disagree somewhat. In this case the '-' is a unary operator, not an additive operator. A unary operator should evaluate before any other operator, at least in this case. The -10 should evaluate immediately as the simple value it is. Then the mod operator is evaluated. So you should not have to put any parenthesis around -10 to obtain the correct result.
Well, that's your personal opinion which is shared by C and related languages, including Borland Pascal.
But Adriaan explicitly asked about standard Pascal which follows the mathematical convention (see ISO 7185, 6.7.1) where there's no special priority of unary operators, e.g. in mathematics -2^2 equals -4, not 4.
Frank