SMath Studio Forum
»
SMath Studio
»
Feature Requests
»
Multiple Binary Boolean Operators in if statement
Rank: Newbie
Groups: Registered
Joined: 22/05/2021(UTC) Posts: 3 Location: Ghetto
|
When I try to perform this if-or statement:
if a=1 ^ a=2 ^ a=3 x=4 else x =5
I end up with this due to forced parenthesis:
if ((a=1 ^ a=2) ^ a=3) x=4 else x =5
Could we have capability for multiple binary operators without forced parenthesis enclosure?
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Hi. The short and honest answer is not. The long and tricky answer is that you can, but you must edit the .sm file and delete the lines with <e type="bracket">(</e> However, unless it's for some publishing purpose or something like that, I don't think it's convenient. Also, you can neither copy nor edit it without the parentheses reappearing. and_tryck.sm (3kb) downloaded 11 time(s).Best regards. Alvaro.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Think in term of productive Bolean. Critical.sm (31kb) downloaded 16 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: Jean Giraud Think in term of productive Bolean. ... lot more involved. Adapted from Frank Rioux MCD 11. Fourier Quantum 2C Mask.sm (23kb) downloaded 8 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
You can always create some function to make it look like you are working with some set of numbers |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
3 users thanked Davide Carpi for this useful post.
|
on 09/05/2022(UTC), on 09/05/2022(UTC), on 09/05/2022(UTC)
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: Davide Carpi You can always create some function to make it look like you are working with some set of numbers Tanks Davide ... coded/saved. Take care ... Jean. Maths Conditional Davide.sm (13kb) downloaded 11 time(s).
|
1 user thanked Jean Giraud for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: Davide Carpi You can always create some function to make it look like you are working with some set of numbers Hi Davide. Great idea. These functions can be very useful for translating matlab programs. They can also be extended to arrays, as the all, any and nnz functions do. Best regards. Alvaro.
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Feature Requests
»
Multiple Binary Boolean Operators in if statement
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.