Multiple Binary Boolean Operators in if statement

Multiple Binary Boolean Operators in if statement - Add multiple binary Boolean "or" / "and" operators without force parenthesis - Poruke

#1 Objavljeno: 6. 5. 2022. 22:53:10
Larry Burns

Larry Burns

0 svidjanja u 3 postova.

Grupa: User

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?
#2 Objavljeno: 7. 5. 2022. 00:27:03
Alvaro

Alvaro

1.139 svidjanja u 1.805 postova.

Grupa: User

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 (
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.

Clipboard01.jpg

and_tryck.sm (2,75 KiB) preuzeto 1654 put(ova).

Best regards.
Alvaro.
#3 Objavljeno: 7. 5. 2022. 08:59:32
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Think in term of productive Bolean.

Critical.sm (30,49 KiB) preuzeto 1687 put(ova).
#4 Objavljeno: 9. 5. 2022. 08:01:56
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

Think in term of productive Bolean.


... lot more involved. Adapted from Frank Rioux MCD 11.

Fourier Quantum 2C Mask.sm (22,51 KiB) preuzeto 1714 put(ova).
#5 Objavljeno: 9. 5. 2022. 08:37:41
Davide Carpi

Davide Carpi

1.444 svidjanja u 2.936 postova.

Grupa: Moderator

You can always create some function to make it look like you are working with some set of numbers


2022-05-09 13_37_05-SMath Solver - [some all none.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 korisnika je svidelo ovu objavu
sergio 9. 5. 2022. 10:55:00, Alvaro 9. 5. 2022. 11:19:00, Arie 9. 5. 2022. 16:16:00
#6 Objavljeno: 9. 5. 2022. 10:06:38
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

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 (12,36 KiB) preuzeto 1694 put(ova).

1 korisnika je svidelo ovu objavu
sergio 9. 5. 2022. 12:46:00
#7 Objavljeno: 9. 5. 2022. 11:25:27
Alvaro

Alvaro

1.139 svidjanja u 1.805 postova.

Grupa: User

Wrote

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.

  • Novi postovi
  • Nema novih postova