Page 1 sur 1

OTHER types data.

Publié : sam. juin 08, 2019 6:49 pm
par compsystems
Hello BP

using the getType() command for the TABLE data type, throwthe word OTHER

What other types of data exist in Xcas outside of those listed?

Thank you

Code : Tout sélectionner


getType(5.0) [enter] NUM

getType(5) [enter] NUM

getType(3+4*i) [enter] EXPR

getType(var01) [enter]  VAR

getType([9,[8,7],[6,5,4]]) [enter] LIST

getType(x+y*i) [enter] EXPR

getType(3/4) [enter] NUM

getType("Hello") [enter] STR

getType(1,2,3) [enter] LIST

getType(set[ a, b ,a, c ]) [enter] LIST 

getType(poly1[ 1, -6, 11, -6 ]) [enter] LIST

getType([[1,2],[3,4]]) [enter] LIST

is_matrix([[1,2],[3,4]]) [enter]  True

getType(f(x):=x+1) [enter] FUNC

phonebook_17:= table("John" : 938477566,"Jack" : 938377264,"Jill" : 947662781)

getType(phonebook_17) [enter] OTHER

getType(9999999999999999999) [enter] OTHER


Re: OTHER types data.

Publié : dim. juin 09, 2019 6:37 pm
par parisse
type returns DOM_MAP for a table, not OTHER.
Cf dispatch.h for all giac types:
_INT_= 0, // int val
_DOUBLE_= 1, // double _DOUBLE_val
// all type below or equal to _DOUBLE_ must be non pointers
_ZINT= 2, // mpz_t * _ZINTptr
_REAL= 3, // mpf_t * _REALptr
// all type strictly below _CPLX must be real types
_CPLX= 4, // gen * _CPLXptr
_POLY= 5, // polynome * _POLYptr
_IDNT= 6, // identificateur * _IDNTptr
_VECT= 7, // vecteur * _VECTptr
_SYMB= 8, // symbolic * _SYMBptr
_SPOL1= 9, // sparse_poly1 * _SPOL1ptr
_FRAC= 10, // fraction * _FRACptr
_EXT= 11, // gen * _EXTptr
_STRNG= 12, // string * _STRNGptr
_FUNC= 13, // unary_fonction_ptr * _FUNCptr
_ROOT= 14, // real_complex_rootof *_ROOTptr
_MOD= 15, // gen * _MODptr
_USER= 16, // gen_user * _USERptr
_MAP=17, // map<gen.gen> * _MAPptr
_EQW=18, // eqwdata * _EQWptr
_GROB=19, // grob * _GROBptr
_POINTER_=20, // void * _POINTER_val
_FLOAT_=21 // immediate, _FLOAT_val

Re: OTHER types data.

Publié : lun. juin 10, 2019 4:34 am
par compsystems
Hello

I use getType() or type() or subtype() according to the context

an improvement with getType

getType(9999999999999999999) [enter] "OTHER"

group it as "NUM"

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

and for a table

phonebook_17:= table("John" : 938477566,"Jack" : 938377264,"Jill" : 947662781)
getType(phonebook_17) [enter] "OTHER"
getType(phonebook_17) [enter] "TABLE"

Re: OTHER types data.

Publié : lun. juin 10, 2019 6:11 pm
par parisse
getType is a TI compatibility instruction, please use type instead.

Re: OTHER types data.

Publié : mar. juin 11, 2019 7:04 pm
par compsystems
From the input line I can generate the following types, please BP, you can add an example for the types of missing objects (1 (int val), 3 (_REAL), 9 (_SPOL1), 11 (_EXT), 14 (_ROOT), 15 (_MOD), 18(_EQW), 19 (_GROB) , etc) in the following list.

Thanks

Code : Tout sélectionner

float_1 := 5.0 
integer_2 := 5
complex_4 := 3+4*i
identifier_6 := var01
list_7 := [9,[8,7],[6,5,4]]
symbolic_8 := x+y*i
rational_10 := 3/4
string_12 := "Hello"
set_2 := set[ a, b ,a, c ]
polynomial_10 := poly1[ 1, -6, 11, -6 ]
function_13 = f(x):=x+1 
map_17:= table("John" : 938477566,"Jack" : 938377264,"Jill" : 947662781)  

Re: OTHER types data.

Publié : mer. juin 12, 2019 8:08 am
par parisse
_REAL : evalf(pi,30)
_MOD: 3 mod 5
other types are intended for internal use. For example internally there are two types of integers: CPU integers (type _INT_==0) and long integers (type _ZINT==2).