Page 1 sur 1

((a=b)*-1)|([a = 4,b = 3]) => -1 ?

Publié : sam. mai 11, 2024 11:13 pm
par compsystems
Hello
with autosimplify flag: none

((a=b)*-1 [enter] returns -a=(-b)
((a>b)*-1 [enter] returns (-b)>(-a)

((a=b)*-1)|([a = 4,b = 3]) [enter] returns (-4=-3)
((a>b)*-1)|([a = 4,b = 3]) [enter] returns (true)*-1 => -1 ? // Shouldn't the left side be resolved first?

((a>b)*-1)|([a = 4,b = 3]) => (-b)>(-a)|([a = 4,b = 3]) => -3 >-4 => true

I think the left side should do a low-level evaluation before replacing what the right side indicates.

Re: ((a=b)*-1)|([a = 4,b = 3]) => -1 ?

Publié : mar. mai 14, 2024 12:28 am
par compsystems
Another possible problem is when an expression is applied in an inequality.

(((x-2)/(x+2))<2)*(x+2) [Enter] ([(6+x)/(2+x),(12+2*x)/(2+x)])>0

=> (x-2) < (2*(x+2))

Re: ((a=b)*-1)|([a = 4,b = 3]) => -1 ?

Publié : mar. mai 14, 2024 11:16 am
par parisse
You should eval the inequation*number before doing substitution.

Re: ((a=b)*-1)|([a = 4,b = 3]) => -1 ?

Publié : mar. mai 14, 2024 9:02 pm
par compsystems
I have noticed that depending on the simplification flag, an assignment is performed.
You can improve the xcas interpreter by adding a flag to the system that allows you to decide whether you want the equal sign to always act as an assignment or not,