| Spis treści | Szukaj | << | >> |
W programie MAPLE nie ma potrzeby definiowania typu zmiennej. Program sam rozpoznaje jaka struktura zapamiętana jest pod daną zmienną.
Do sprawdzenia typu zmiennej wykorzystuje się
polecenie whattype(z) podając jako argument
nazwę zmiennej z, której typ chcemy zbadać. Na przykład:
> a;
a
> whattype(a);
symbol
> a:=1;
a := 1
> whattype(a);
integer
> a:=1.;
a := 1.
> whattype(a);
float
Funkcja whattype zwraca jedną z
następujących wartości:
Inną funkcją służącą do określania typu jest
funkcja type(expr,t), która
zwraca wartość logiczną "prawda" jeżeli zmienna
expr jest typu t. Oto lista nazw typów, które
mogą być użyte w funkcji type:
abstract_rootof algebraic algext algfun
algnumext algnum And and
anyfunc anyindex anything appliable
applied arctrig array Array
assignable atomic attributed BooleanOpt
boolean builtin character ClosedIdeal
CommAlgebra complexcons complex composition
constant const cubic cx_infinity
cx_zero dependent dictionary dimension
disjcyc embedded_axis embedded_imaginary embedded_real
equation evenfunc even expanded
extended_numeric extended_rational facint filedesc
finite float float[] form
fraction freeof function global
hfarray identical imaginary implies
indexable indexedfun indexed infinity
integer intersect in last_name_eval
laurent linear listlist list
literal local logical mathfunc
matrix Matrix minus moduledefinition
module monomial MVIndex name
negative neg_infinity negint negzero
NONNEGATIVE nonnegative nonnegint nonposint
nonpositive nonreal nothing Not
not numeric oddfunc odd
operator OreAlgebra Or or
package patfunc patindex patlist
Point point polynom pos_infinity
posint positive poszero prime
procedure property protected quadratic
quartic Queue radalgfun radalgnum
radext radfunext radfun radical
radnumext radnum range Range
rational ratpoly ratseq realcons
real_infinity relation RootOf rtable
satisfies scalar SDMPolynom sequential
series SERIES set sfloat
ShortTermOrder SkewAlgebra SkewParamAlgebra SkewPolynomial
specfunc specified_rootof specindex sqrt
Stack stack stdlib std
string subset suffixed SymbolicInfinity
symbol symmfunc table tabular
taylor TermOrder TEXT trigh
trig truefalse <= <>
< || . ^
* + @ @@
= ! typefunc typeindex
type undefined uneval union
unit_name unit vector Vector
verification verify with_unit xor
zppoly
Do zmiany typu zmiennej (przekonwertowania)
wykorzystuje się polecenie
convert(expr,t), które
konwertuje wyrażenie expr na typ t.
Nazwy typów, jakie mogą być użyte w tej funkcji to:
Abel_RNF abs and arabic array base Bessel binary binomial boolean_function bytes compose confrac conversion_table convert/'*' convert/'+' D decimal degrees DESol diff dimensions disjcyc Ei equality erfc erf exp expln expsincos factorial FirstKind float fullparfrac function_rules GAMMA global Heaviside hexadecimal hex hypergeom int Int iupac linearODE list listlist ln local mathorner matrix Matrix MeijerG metric mod2 ModifiedMeijerG multiset name NormalForm numericproc octal or package parfrac permlist piecewise PLOT3Doptions PLOToptions polar POLYGONS polynom pwlist radians radical rational ratpoly RealRange record relation Riccati roman RootOf SecondKind set signum sincos sqrfree StandardFunctions std stdle string sum Sum surd symbol system table tan temperature to_special_function truefalse unit_free units vector Vector windchill xor y_x