[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.8.1 type | ||
6.8.2 ntype | ||
6.8.3 vtype |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
type
:: Returns an integer which identifies the type of the object obj in question.
integer
arbitrary
0
number
polynomial (not number)
rational expression (not polynomial)
list
vector
matrix
string
structure
distributed polynomial
32bit unsigned integer
error object
matrix over GF(2)
MATHCAP object
first order formula
VOID object
ntype()
.
For further classification of variable, use vtype()
.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ntype
:: Classifier of type num. Returns a sub-type number, an integer, for obj.
integer
number
rational number
floating double (double precision floating point number)
algebraic number over rational number field
arbitrary precision floating point number (bigfloat)
complex number
element of a finite field
element of a large finite prime field
element of a finite field of characteristic 2
newalg(x^2+1)
and the unit of
imaginary number @i
have different number sub-types, and
it is treated independently.
[0] [10/37,ntype(10/37)]; [10/37,0] [1] [10.0/37.0,ntype(10.0/37.0)]; [0.27027,1] [2] [newalg(x^2+1)+1,ntype(newalg(x^2+1)+1)]; [(#0+1),2] [3] [eval(sin(@pi/6)),ntype(eval(sin(@pi/6)))]; [0.49999999999999999991,3] [4] [@i+1,ntype(@i+1)]; [(1+1*@i),4]
type
.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
vtype
:: Type of indetarminates var.
integer
indeterminate
ordinary indeterminate, which can be directly typed in on a keyboard (a,b,x,afo,bfo,...,etc.)
Special indeterminate, created by uc()
(_0
, _1
, _2
, ... etc.)
function form (sin(x)
, log(a+1)
, acosh(1)
, @pi
, @e
, ... etc.)
functor (built-in functor name, user defined functor, functor for
the elementary functions)
: sin
, log
, ... etc)
a();
’ will cause an error, but it changes
the system database for identifiers. After this error, you will find
‘vtype(a)
’ will result 3. (Identifier a
is registered as
a user defined functor).
@pi
and @e
are treated as indeterminates,
whereas they are treated as numbers within functions eval()
and
pari()
.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] |
This document was generated on June 19, 2018 using texi2html 5.0.