Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Dara_144  
#1 Posted : 07 May 2022 04:53:10(UTC)
Dara_144

Rank: Newbie

Groups: Registered
Joined: 22/05/2021(UTC)
Posts: 3
United States
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?

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Razonar  
#2 Posted : 07 May 2022 06:27:03(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

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.

Clipboard01.jpg

and_tryck.sm (3kb) downloaded 11 time(s).

Best regards.
Alvaro.
Offline Jean Giraud  
#3 Posted : 07 May 2022 14:59:32(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Think in term of productive Bolean.

Critical.sm (31kb) downloaded 16 time(s).
Offline Jean Giraud  
#4 Posted : 09 May 2022 14:01:56(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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).
Offline Davide Carpi  
#5 Posted : 09 May 2022 14:37:41(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
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


2022-05-09 13_37_05-SMath Solver - [some all none.sm_].png
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 3 users thanked Davide Carpi for this useful post.
on 09/05/2022(UTC),  on 09/05/2022(UTC),  on 09/05/2022(UTC)
Offline Jean Giraud  
#6 Posted : 09 May 2022 16:06:38(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
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).

thanks 1 user thanked Jean Giraud for this useful post.
on 09/05/2022(UTC)
Offline Razonar  
#7 Posted : 09 May 2022 17:25:27(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
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.

Users browsing this topic
Guest
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.