Expression to get "True" value between two numbers?

I do try to build an expression that will generate a True value between two numbers, like 5 and 10 and in any other condition to be False, but seems that my logic it is not working as expected. Unfortunately I do get only False in all situations. How I can this expression right?


True_between_5_and_10.gh (10.4 KB)

this should work


True_between_5_and_10_inno.gh (11.6 KB)

if statement works like if(condition, yes consequence, no consequence)

so in this:
image

condition = x>5 OR x<10
yes consequence = False
no consequence = True

when you plug a 6, condition is (6>5) OR (6<10) = True OR True = True
yes consequence = False, so you get a False :slight_smile:

actually, with that OR, any number you plug will be greater than 6 or smaller than 10, so you will always get the “yes consequence”

2 Likes

Your True and False values are reversed and you need to use “and” instead of “or”.

2 Likes