Post Reply 
Existing CAS commands --> Prime discussion
12-24-2018, 03:15 AM
Post: #61
RE: Existing CAS commands --> Prime discussion
importance of UNQUOTE CMD, evaluate subparts of expressions.

y:=3; x:=5;
a:=quote(x+unquote(y)); [enter] returns
x+3

b:=quote(unquote(x)+y) [enter] returns
y+5

eval(a); eval(a,1); eval(a,2); [enter] returns
8, y+5, 8

The good enough is the enemy of the excellent.
Find all posts by this user
Quote this message in a reply
02-19-2019, 02:52 AM (This post was last modified: 02-19-2019 08:08 PM by compsystems.)
Post: #62
RE: Existing CAS commands --> Prime discussion
undocumented functions and operators


1: increment at 1
a:=a+1
increment(a,1)
a+=1

2: decrement at 1
a:=a-1
decrement(a,1)
a-=1

3: increment
a:=a+b
increment(a,b)
a+=b

4: decrement
a:=a-b
decrement(a,b)
a-=b

5: mulcrement
a:=a*b
mulcrement (a,b)
a*=b

6: divcrement
a:=a/b
divcrement (a,b)
a/=b

7: float("3.14") [enter] 3.14
float(10) [enter] 10.0

8: bool( 1 ) [enter] true
bool( 0 ) [enter] false
bool( -1 ) [enter] true

The good enough is the enemy of the excellent.
Find all posts by this user
Quote this message in a reply
02-22-2019, 08:36 PM (This post was last modified: 02-26-2019 02:42 AM by compsystems.)
Post: #63
RE: Existing CAS commands --> Prime discussion
getType command

The XCas getType() command is not synonymous with type or TYPE cmds, the important thing about this command that is not included in the hpprime
is that it groups several types of objects by common characteristics, for example

getType(5.0 ), getType( 5 ), getType( 3/4 ) [enter] "NUM", "NUM", "NUM"

Mathematical expressions as"EXPR" and math constants
getType( 3+4*i ), getType( x+i*y ), getType( 3*pi ), getType( sqrt(-1) ) , getType( e ) [enter]"EXPR", "EXPR", "EXPR", "EXPR", "EXPR"

Lists, sequences, sets and polynomials as “LIST"
seq1:=(1,2,3)
getType( seq1), getType( [9,[8,7],[6,5,4]]), getType( [9 ,8 ,7] ), getType( set[a , b, c, a] ), getType( poly1[1 ,-6 , 11 ,-6] ) [enter] "LIST", "LIST","LIST","LIST","LIST"
Difference matrix of lists
getType( [[1,2],[3,4]] ), getType( [[1,2,3,4]], getType( [[1],[2],[3],[4]] ) [enter] "MAT", "MAT", "MAT"

getType( var01 ) [enter] "VAR"
getType( "Hello" ) [enter] "STR"
getType( f(x):=x+1) [enter] "FUNC"


getType(5.0 ), getType( 5 ), getType( 3+4*i ), getType( x+i*y ), getType( [9,[8,7],[6,5,4]]), getType( [9 ,8 ,7] ), getType( set[a , b, c, a] ), getType( poly1[1 ,-6 , 11 ,-6] ), getType( [[1,2],[3,4]] ), getType( var01 ), getType( "Hello" ), getType( f(x):=x+1)
"NUM","NUM","EXPR","EXPR","LIST","LIST","LIST","LIST","MAT","VAR","STR","FUNC"

The good enough is the enemy of the excellent.
Find all posts by this user
Quote this message in a reply
Post Reply 




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