If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Double condition Boolean
2 posts
• Page 1 of 1
Double condition Boolean
Hi
I just find this code line that i didn't know was possible.
X = (a<b)|(b<c);
With this X will be true if b<a or b>c.
Or false only if a<b<c.
Which is the contrary of what i expected...
Did you know a way to make an inverted result or what is supposed to do the | ?
Or another way to make double condition boolean ?
Thanks for any response !)
I just find this code line that i didn't know was possible.
X = (a<b)|(b<c);
With this X will be true if b<a or b>c.
Or false only if a<b<c.
Which is the contrary of what i expected...
Did you know a way to make an inverted result or what is supposed to do the | ?
Or another way to make double condition boolean ?
Thanks for any response !)
- Attachments
-
- Double conditional Bolean.fsm
- (13.44 KiB) Downloaded 583 times
- Tepeix
- Posts: 361
- Joined: Sat Oct 16, 2021 3:11 pm
Re: Double condition Boolean
Sorry i was wrong. Inverting my input variables.
Let's say we have Y.
X = (0<Y)|(Y<1); will always be true because Y>0 or Y<1.
X = (0>Y)|(Y>1); is true if Y<0 or Y>1.
X = (0<Y)&(Y<1); is true only when 0<Y<1.
It's also possible to add more condition like
X = (a>b)&(a>c)&(a<d);
X = (a)|(b)|(c);
X = (a&b)|(c&d);
Let's say we have Y.
X = (0<Y)|(Y<1); will always be true because Y>0 or Y<1.
X = (0>Y)|(Y>1); is true if Y<0 or Y>1.
X = (0<Y)&(Y<1); is true only when 0<Y<1.
It's also possible to add more condition like
X = (a>b)&(a>c)&(a<d);
X = (a)|(b)|(c);
X = (a&b)|(c&d);
- Tepeix
- Posts: 361
- Joined: Sat Oct 16, 2021 3:11 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 70 guests