Page 1 sur 1

(a<b)+c

Publié : sam. sept. 20, 2025 5:00 am
par compsystems
Hello, why doesn't the distributive law apply in the arithmetic case?

(a<b)+c [enter] (b+c)>(c+a)

(9>8)-1 [enter] true-1, (1) -1 = 0
(9>8)-1 [enter] 9-1 < 8-1 , 8<7, true

Re: (a<b)+c

Publié : sam. sept. 20, 2025 5:22 am
par parisse
You can prevent evaluation with quote
quote(9>8)-1

Re: (a<b)+c

Publié : mar. sept. 30, 2025 6:36 pm
par compsystems
Why does the computational engine apply the rule of evaluating the left side first when it is an arithmetic operation? This is a standard in other CASs.

Re: (a<b)+c

Publié : jeu. oct. 02, 2025 8:13 am
par parisse
evaluation is done from 1st arg to last arg of commands, it's probably the same for other CAS.

Re: (a<b)+c

Publié : mar. oct. 07, 2025 1:15 am
par compsystems
If symbolically (a<b)+c is interpreted as an inequality, adding +c to it, (b+c)>(a+c), arithmetically it has to be the same to be consistent.

Re: (a<b)+c

Publié : mar. oct. 07, 2025 4:58 am
par GermanXG
I understand that (a<b)+c is interpreted as "the result of inequality a<b plus c". But I also understand what you want. However it can be done in this way:

Code : Tout sélectionner

ineq: = a<b [enter} b>a
ineq+c [enter] (b+c)>(a+c)