Post Reply 
Existing CAS commands --> Prime discussion
12-09-2018, 05:07 PM (This post was last modified: 12-09-2018 08:34 PM by compsystems.)
Post: #47
RE: Existing CAS commands --> Prime discussion
the subtype() command is required to identify the following types of objects

Xcas/HPprime
type(set[a,a,b]),type(poly1[0,0,3,-1]),type(a,a,b) [↵] returns
DOM_LIST,DOM_LIST,DOM_LIST

Xcas
subtype(set[a,a,b]),subtype(poly1[0,0,3,-1]),subtype(a,a,b) [↵] returns
2,10,1

according to XCAS help
subtype() cmd
Returns 1 for a sequence: for example (a,a,b),
2 for a set: set[a,a,b],
10 for a polynomial: poly1[0,0,3,-1]
and 0 otherwise.

PHP Code:
purge(a,b
// +0 to obtain the numeric value of the reserved word or constant
DOM_FLOAT+0,DOM_INT+0,DOM_COMPLEX+0,DOM_IDENT+0,DOM_LIST+0,DOM_SYMBOLIC+0,DOM_RAT+0,DOM_STRING+0,DOM_FUNC+0 ↵
1
,2,4,6,7,8,10,12,13

type
(3.0↵ DOM_FLOAT
type
(3.0)+0 ↵ 1  

type
(3↵ DOM_INT
type
(3)+0 ↵ 2 

type
(3+4*i↵ DOM_COMPLEX
type
(3+4*i)+0 ↵ 4

type
(abc↵ DOM_IDENT
type
(abc)+0  ↵ 6

type
({a,a,b}) ↵ DOM_LIST
type
({a,a,b})+0 ↵ 7

type
(a+b)↵ DOM_SYMBOLIC
type
(a+b)+0 ↵ 8

type
(3/4)↵ DOM_RAT
type
(3/4)+0 ↵ 10

type
("3/4")↵ DOM_STRING
type
("3/4")+0↵ 12

type
(f(x):=x+1)↵ DOM_FUNC
type
(f(x):=x+1)+0 ↵ 13 

set1 
:= set[a,a,b]; type(set1↵ DOM_LIST

type
(set[a,a,b]);↵ DOM_LIST
type
(poly1[0,0,3,-1]); ↵ DOM_LIST
type
(a,a,b); ↵ DOM_LIST

type
(set[a,a,b]),type(poly1[0,0,3,-1]),type(a,a,b)
DOM_LIST,DOM_LIST,DOM_LIST

subtype
(set[a,a,b]),subtype(poly1[0,0,3,-1]),subtype(a,a,b),subtype(a+b*i)
2,10,1,
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Existing CAS commands --> Prime discussion - compsystems - 12-09-2018 05:07 PM



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