HP Forums
Problem with -2<-1 returns 1 => true - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Problem with -2<-1 returns 1 => true (/thread-10926.html)



Problem with -2<-1 returns 1 => true - compsystems - 06-16-2018 10:03 PM

Hello
A simple update for the next firmware.
Please, improve the consistency in the output

HOME MODE == NUMERICAL MODE
CAS MODE == SYMBOLIC MODE

-2<-1 returns 1 (ok for numerical value for HOME), but for the output for CAS mode should be: true

1 or 1 returns 1
1 xor 1 returns 1

It works very well in other cases, for example

not(-2≤-1) returns false (ok)

1 AND 1 returns true

Another examples
[Image: relationalOperators_hp_prime_versus_xcas.png]

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

Xcas NONE OR SIMPLIFY MINIMUM:
(x+y)^2 == x^2+2*x*y+y^2 returns: false, hpprime returns 0


RE: -2<-1 returns 1 => true - Jean-Michel - 06-19-2018 11:20 AM

Hello

Which revision and settings do you have?
I get 1 on both calculator and emulator, be it in Textbook, Algebraic or RPN mode.
Version: 2018 1 24. Rev: 13333

Regards.


RE: -2<-1 returns 1 => true - JamesWilliams - 06-19-2018 12:32 PM

I get the same behavior as compsystems.
In CAS view,
-2<-1 --> 1
-2<=-1 --> true
In Home view,
-2<-1 --> 1
-2<=-1 --> 1
I have version 2018-02-12 (13441) on the original hardware version A.


RE: -2<-1 returns 1 => true - compsystems - 06-20-2018 05:05 PM

Another case

5 - (+3) => 2 exact
5 + (-3) => 2. approx this happens sometimes, not always


RE: -2<-1 returns 1 => true - JamesWilliams - 06-26-2018 03:42 PM

comsystems,
I cannot reproduce this behavior. Could you please specify Home View or CAS View each time you submit a problem? By the way, 5-(+3) gives a syntax error in Home View if you are explicitly putting a plus sign before the 3.


RE: -2<-1 returns 1 => true - compsystems - 06-28-2018 07:49 PM

Other problems
Boolean operators are not yet working on CAS mode, classpad300/400 ok, ti89/92/v200, ok, hpprime =(

0: NOT(x<13) RETURNS x≥13 // ok
http://www.wolframalpha.com/input/?i=NOT(x%3C13)

1: (x<13) AND (x>5) RETURNS (13>x) AND (x>5) // OK
http://www.wolframalpha.com/input/?i=(x%3C13)+AND+(x%3E5)

2: (x<13) AND (x<5) RETURNS (13>x) AND (5>x) // => x<5
http://www.wolframalpha.com/input/?i=(x%3C13)+AND+(x%3C5)

3: (x<13) OR (x>5) RETURNS (13>x) OR (x>5) // => TRUE
http://www.wolframalpha.com/input/?i=(x%3C13)+OR+(x%3E5)

4: (x<13) OR (x<5) RETURNS (13>x) OR (5>x) // => x<13
http://www.wolframalpha.com/input/?i=(x%3C13)+OR+(x%3C5)

5: (x<13) XOR (x<5) RETURNS 0 ? // (x>=5) AND x<13 // [5, 12)
http://www.wolframalpha.com/input/?i=x%3C13+Xor+x%3C5

6: (x>=5) AND x<13 RETURNS
http://www.wolframalpha.com/input/?i=(x%3E%3D5)+AND+x%3C13


RE: -2<-1 returns 1 => true - compsystems - 07-20-2018 02:45 PM

These small problems have not yet been resolved.

"HP Prime Graphing Calculator
Software Version: 2.0.0.13865 (2018 07 06)
Hardware Version: Emu
CAS Version: 1.4.9
"


RE: Problem with -2<-1 returns 1 => true - compsystems - 07-24-2018 05:11 PM

CAS:

OR
1 or 1 returns 1 => true
True or True returns true

XOR
1 xor 1 returns Error: syntax error => false
true xor true [enter] Error: syntax error => false

AND
1 and 1 returns true
true and true returns true


RE: Problem with -2<-1 returns 1 => true - ijabbott - 07-24-2018 08:30 PM

(07-24-2018 05:11 PM)compsystems Wrote:  CAS:

OR
1 or 1 returns 1 => true
True or True returns true

XOR
1 xor 1 returns Error: syntax error => false
true xor true [enter] Error: syntax error => false

AND
1 and 1 returns true
true and true returns true

It's not a very clear bug description, but I think the bug you are describing is that xor is not automatically changed to XOR, which is inconsistent with related operators? In that case, a related bug is that not without parentheses is not automatically changed to NOT.