You have ORed your three checks so that if any one of them is within limits then True
is returned. You need to AND them.
If your if
returns true
or false
, you don't need an if.
limit_l1 < tag1 && tag1 < limit_h1
&&
limit_l2 < tag2 && tag2 < limit_h2
&&
limit_l3 < tag3 && tag3 < limit_h3
8 Likes