Post Reply 
[Help: CAS Code] Comparing exact with approx expressions
11-05-2016, 08:39 PM (This post was last modified: 11-05-2016 09:17 PM by compsystems.)
Post: #2
RE: [Help: CAS Code] Comparing exact with approx expressions
sorry for my bad English

expr0:=4/2 [enter] 2 ok
string(expr0) [enter] "2" ok

expr1:=quote(4/2) [enter] 4/2 ok
string(expr1) [enter] "2" =( I want to display as "4/2"
now
string(eval(var1,1)) [enter] "4/2" ok =) but within a program, how I make so that the entry is stored as quote?

PHP Code:
compare1(expr1expr2):=
begin
  local str1
:= string(eval(expr1,1));
  
local str2:= string(eval(expr2,1));
  
local rtn;
  print();
  print(
str1); wait();
  print(
str2); wait();
  if 
eq(str1,str2then
      rtn
:= true;
  else
      
rtn:= false;
  
end;
  print(
rtn); wait();
  return 
rtn;
end

compare1(2,4/2) true =(
compare1('2','4/2') false =) but forcing the entry as '' the idea is that the program will become ''

I think that an object between single quotes '' must be stored as such and not evaluate it, otherwise the QUOTE command has not purpose, are you agree?

expr2:='4/2'

type(expr2) -> DOM_QUOTEDEXPR // without evaluate
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [Help: CAS Code] Comparing exact with approx expressions - compsystems - 11-05-2016 08:39 PM



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