Hi,
I just would had written ...Code:if (poscnt<azimval) or (azimval-poscnt >= 1800) then
to be sure of what happens ... ( might be overkill ... but ... )Code:if (poscnt<azimval) or ((azimval-poscnt) >= 1800) then
Alain
Hi,
I just would had written ...Code:if (poscnt<azimval) or (azimval-poscnt >= 1800) then
to be sure of what happens ... ( might be overkill ... but ... )Code:if (poscnt<azimval) or ((azimval-poscnt) >= 1800) then
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
That's a good point. What does happen first, the comparison or the subtraction, in the first snippet. In the second you'd be sure the subtraction was done prior to the comparison. I'm sure I'll get schooled here but with code there is often no such thing as overkilled overkill.
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