Hi,
In my case the subtraction happens first.
C.
Hi,
In my case the subtraction happens first.
C.
At least for C languages this, according to wikipedia, is the order of operations. I tried to find something more specific to PBP or the BASIC stamp but couldn't. This topic may be getting off topic but I thought it interesting to know at least a pseudo answer.
1 () [] -> . :: Function call, scope, array/member access
2 ! ~ - + * & sizeof type cast ++ -- (most) unary operators, sizeof and type casts (right to left)
3 * / % MOD Multiplication, division, modulo
4 + - Addition and subtraction
5 << >> Bitwise shift left and right
6 < <= > >= Comparisons: less-than, ...
7 == != Comparisons: equal and not equal
8 & Bitwise AND
9 ^ Bitwise exclusive OR (XOR)
10 | Bitwise inclusive (normal) OR
11 && Logical AND
12 || Logical OR
13 ? : Conditional expression (ternary)
14 = += -= *= /= %= &= |= ^= <<= >>= Assignment operators (right to left)
15 , Comma operator
Precedence from the pbp3 manual
The following table lists the operators in default hierarchal order. (Parentheses will
override.) Operators with the same precedence level (on the same line in the table
below) will be evaluated in the order (left to right) that they are encountered in the
written expression.
Highest Precedence
( ) (anything enclosed in parentheses)
- (unary)
! or NOT, ABS, COS, DCD, DIV32, NCD, SIN, SQR
<<, >>, ATN, DIG, HYP, MAX, MIN, REV
*, /, **, */, //
+, - (in math), ~
= or ==, <> or !=, <, <=, >, >=
&, |, ^, &/, |/, ^/
AND, OR, XOR, ANDNOT, ORNOT, XORNOT
Lowest Precedence
camerart's problem is that he is using Oshonsoft's version of picbasic not pbppro
picbasic != pbppro
Bookmarks