OTHER types data.

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 561
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

OTHER types data.

Message par compsystems » sam. juin 08, 2019 6:49 pm

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


parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: OTHER types data.

Message par parisse » dim. juin 09, 2019 6:37 pm

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

compsystems
Messages : 561
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: OTHER types data.

Message par compsystems » lun. juin 10, 2019 4:34 am

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"

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: OTHER types data.

Message par parisse » lun. juin 10, 2019 6:11 pm

getType is a TI compatibility instruction, please use type instead.

compsystems
Messages : 561
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: OTHER types data.

Message par compsystems » mar. juin 11, 2019 7:04 pm

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)  

parisse
Messages : 5739
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: OTHER types data.

Message par parisse » mer. juin 12, 2019 8:08 am

_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).

Répondre