CAS command question
|
01-06-2017, 06:59 PM
(This post was last modified: 01-06-2017 08:06 PM by compsystems.)
Post: #41
|
|||
|
|||
RE: CAS command question
I have noticed that the CAS history works different to the execution of a CAS program
The first step before programming is to test the sequence of steps of the algorithm on CAS history CAS MODE s := "(1/3)*x+(1/6)*y<=80"; ⇨ "(1/3)*x+(1/6)*y<=80" // ok expr( s ); ⇨ expr( "(1/3)*x+(1/6)*y<=80" ) ⇨ 80 ≥ (1/3)*x+ (1/6)*y // ok left( expr(s) ); ⇨ expr( "(1/3)*x+(1/6)*y<=80" ) ⇨ left( 80 ≥ (1/3)*x+ (1/6)*y ) ⇨ 80 // ok left( expr( "'"+s+"'" )); ⇨ left( expr( "'"+"(1/3)*x+(1/6)*y<=80"+"'" ) ⇨ left( '(1/3)*x+(1/6)*y<=80' ) ⇨ (1/3)*x+(1/6)*y // ok left(expr("'"+s+"'")) ⇨ (1/3)*x+(1/6)*y // ok Now step by step expr( "'"+s+"'" ); ⇨ (1/3)*x+(1/6)*y ≤ 80 ⇦ It has removed the quotes (Apparently well.). The quotation marks must be preserved the next step fails Copying to the entry line [up] [copy] [enter] 80≥ (1/3)*x+(1/6)*y (wrong for the above reason) expr( "'"+s+"'" ); ⇨ '(1/3)*x+(1/6)*y ≤ 80' // This is the correct output An easier example HP-PRIME 3+4; [ENTER] 7 // ok '3+4'; [ENTER] 3+4 (Apparently well.). [up key] [copy] 3+4 [enter] 7 // wrong This should be copied with quotation marks, or better with the function QUOTE() [up key] [copy] '3+4' or quote(3+4) [enter] '3+4' // ok HP50G '3+4' [ENTER] '3+4' // ok [up or HIST key] [copy (right-shift+var)] then [on] [paste] [ENTER] '3+4' // ok and not 7 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)