Post Reply 
Step-by-step programs in CAS
01-10-2017, 05:56 PM
Post: #2
RE: Step-by-step programs in CAS
(01-10-2017 05:43 PM)compsystems Wrote:  Hello, I'm trying the following code (Step-by-step), but I see something strange in the output, please run the following program

PHP Code:
#cas
    
testInequality():=
    
begin
     local expr0
;
     print(
"");
     
expr0 := '(3*x^2-2*x-2) < (2*x^2-3*x+4)';
     
//expr0 := (3*x^2-2*x-2) < (2*x^2-3*x+4);
     
print("step1: " expr0);

     
expr0 := expr0  -2*x^2
     print(
"step2: " expr0); expr0 := simplify(expr0); print("simplify ⇨ "+expr0);

     
expr0 := expr0 3*x;
     print(
"step3: " expr0); expr0 := simplify(expr0); print("simplify ⇨ "+expr0);

     
expr0 := expr0  -­4;
     print(
"step4: " expr0); expr0 := simplify(expr0); print("simplify ⇨ "+expr0);
     
//return expr0;
     
return [ expr0left(expr0), right(expr0) ];
    
end;
#end 


testInequality();

[
expr0: (--­4+4)>(x^2+x--­4-2) ?
left: --­4+4 ?
right: x^2+x--­4-2 ?
]

This is expected
[0>(x^2+x-6), 0, x^2+x-6]

When I copied your code, the "-" symbol in front of the 4 (in "step 4") was translated to two dashes: --4. Perhaps your editor is not using the correct symbol for subtraction.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Step-by-step programs in CAS - compsystems - 01-10-2017, 05:43 PM
RE: Step-by-step programs in CAS - Han - 01-10-2017 05:56 PM



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