Existing CAS commands --> Prime discussion
|
02-22-2019, 08:36 PM
(This post was last modified: 04-25-2019 08:46 PM 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" Example of use of the getType function. PHP Code: #Xcas 1/8*(12*x^2-4), 1/8*(12*y^2-4), poly1[3/2,0,-1/2],2 99/2, 1/8*(12*cos(t)**2-4) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)