(a<b)+c

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 613
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

(a<b)+c

Message par compsystems » sam. sept. 20, 2025 5:00 am

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

parisse
Messages : 5916
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: (a<b)+c

Message par parisse » sam. sept. 20, 2025 5:22 am

You can prevent evaluation with quote
quote(9>8)-1

compsystems
Messages : 613
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: (a<b)+c

Message par compsystems » mar. sept. 30, 2025 6:36 pm

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.

parisse
Messages : 5916
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: (a<b)+c

Message par parisse » jeu. oct. 02, 2025 8:13 am

evaluation is done from 1st arg to last arg of commands, it's probably the same for other CAS.

compsystems
Messages : 613
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: (a<b)+c

Message par compsystems » mar. oct. 07, 2025 1:15 am

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.

GermanXG
Messages : 18
Inscription : mar. déc. 24, 2024 6:24 am

Re: (a<b)+c

Message par GermanXG » mar. oct. 07, 2025 4:58 am

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) 

Répondre