HP Forums

Full Version: homogeneity: Relational Operators A==B => true/false
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
expr1:=[5≤8, 9≥8, sqrt(4)≠2, sqrt(4)=2, sqrt(4)==2, 1 AND 0, true and false];

returns xcas: [true,true,false,2=2,true,false,false]

expr2:=[x≤y, x≥y, 'x≠y', x≠y, x==y, x=y, x AND y];

returns xcas: [y>=x,x>=y,x<>y,true,false,x=y,(x and y)]

eval(expr2(3),1);
returns xcas: x<>y

eval(expr2(3),2);
returns xcas: true


[Image: relationalOperators_hp_prime_versus_xcas.png]
In the first release of firmware 2018, I observe that the expressions that return A≠B already throw true or false, but their inverse A==B still returns a numerical value 1/0.

I think that uniformity should be given, in CAS mode true/false, and in numeric mode (home) 1/0. From the point of view of the logic of an algorithm, it is indifferent if it returns true/false or 1/0, but from the didactic point, sometimes returning true and other times 1, it can cause repeated questions in the students. Why does this happen?
The majority of users of this forum, and even the developers do not disagree with me, because they are limited to the use of the device, in my case I use it as a tool in the classroom.

Xcas SIMPLIFY MAXIMUM:
(x+y)^2 == x^2+2*x*y+y^2
returns:
true

Xcas NONE OR SIMPLIFY MINIMUM:
(x+y)^2 == x^2+2*x*y+y^2
returns:
false
Reference URL's