Post Reply 
[CAS] inconsistent evaluation
11-07-2016, 03:00 AM (This post was last modified: 11-07-2016 03:37 AM by compsystems.)
Post: #1
[CAS] inconsistent evaluation
Hello Hp-Prime user and developers

Flags: Simplify none, exact mode off, and cas mode on

run line by line the following script

Quote:c:=1+(-a-b); [enter] returns 1.-a-b
but
c1:=1-a-b; [enter] returns 1.-a-b

c==c1 [enter] returns true

x1:=1/10.;
y1:=1/9.;
x2:=100/8.;
y2:=100/3.;
x3:=100/4.;
y3:=100/9.;
x:=379/70.;
y:=904/63.;
d:=(y2-y3)*(x1-x3)+(x3-x2)*(y1-y3);
na:=(y2-y3)*(x-x3)+(x3-x2)*(y-y3);
nb:=(y3-y1)*(x-x3)+(x1-x3)*(y-y3);
a:=na/d;
b:=nb/d; [enter] ....

c:=1+(-a-b); [enter] returns 0
but
c1:=1-a-b; [enter] returns −1.7763568394*10^−15

Why when evaluate c <> c1? if c is equal to c1
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[CAS] inconsistent evaluation - compsystems - 11-07-2016 03:00 AM



User(s) browsing this thread: 1 Guest(s)