Post Reply 
CAS: math expresion -> logical evaluation
08-27-2016, 03:04 PM (This post was last modified: 08-27-2016 04:06 PM by Didier Lachieze.)
Post: #2
RE: CAS: math expresion -> logical evaluation
What about :
Code:
EXPORT EvalLogic(expression)
BEGIN
  LOCAL s;
  s:=REPLACE(STRING(expression),"=","==");
  CAS(s);
END;

EvalLogic('0=0') -> 1
EvalLogic('0=1') -> 0
EvalLogic('10*e^5-10*e^10=0') -> 0

And in CAS mode you can also evaluate expressions with undefined variables :

EvalLogic('2*x = x+x') -> 1

[Edited to support undefined variables]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: CAS: math expresion -> logical evaluation - Didier Lachieze - 08-27-2016 03:04 PM



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