Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- algebraic operation question
August 12, 2015, 12:57 am
rate this thread
When using algebraic operation, do I need to always
The following always gives correct answer:
if (( "$LatestRev" ge "$OldRev" ) &&
( $LatestRevLength == $OldRevLength ))
The following gets it wrong occasionally:
if ( "$LatestRev" ge "$OldRev" &&
$LatestRevLength == $OldRevLength )
What is the sequence of algebraic operations and
which has dominance over the other? (I take it
"&&" has dominance over "ge" and "==".)
Re: algebraic operation question
Done. Right there a the top too! Thank you!
You know it occures to me that for readability, I should
use the () even when I don't have to.
Perl operators have the following associativity and precedence,
listed from highest precedence to lowest. ...
left terms and list operators (leftward)
nonassoc ++ --
right ! ~ \ and unary + and -
left =~ !~
left * / % x
left + - .
left << >>
nonassoc named unary operators
nonassoc < > <= >= lt gt le ge
nonassoc == != <=> eq ne cmp ~~
left | ^
left || //
nonassoc .. ...
right = += -= *= etc.
left , =>
nonassoc list operators (rightward)
left or xor