14
<title>Maxima Manual: 5. Operators</title>
14
<title>Maxima 5.17.1 Manual: 5. Operators</title>
16
<meta name="description" content="Maxima Manual: 5. Operators">
17
<meta name="keywords" content="Maxima Manual: 5. Operators">
16
<meta name="description" content="Maxima 5.17.1 Manual: 5. Operators">
17
<meta name="keywords" content="Maxima 5.17.1 Manual: 5. Operators">
18
18
<meta name="resource-type" content="document">
19
19
<meta name="distribution" content="global">
20
20
<meta name="Generator" content="texi2html 1.76">
156
156
<td valign="middle" align="left"> </td>
157
157
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
158
158
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
159
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
159
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
160
160
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
162
162
<h1 class="chapter"> 5. Operators </h1>
195
196
<td valign="middle" align="left"> </td>
196
197
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
197
198
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
198
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
199
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
199
200
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
201
202
<h2 class="section"> 5.1 nary </h2>
202
203
<p>An <code>nary</code> operator is used to denote a function of any number of
203
204
arguments, each of which is separated by an occurrence of the
204
205
operator, e.g. A+B or A+B+C. The <code>nary("x")</code> function is a syntax
205
extension function to declare x to be an <code>nary</code> operator.
206
extension function to declare <code>x</code> to be an <code>nary</code> operator.
206
207
Functions may be declared to be
207
208
<code>nary</code>. If <code>declare(j,nary);</code> is done, this tells the simplifier to
208
209
simplify, e.g. <code>j(j(a,b),j(c,d))</code> to <code>j(a, b, c, d)</code>.
210
<p>See also <code>syntax</code>.
211
<p>See also <code>Syntax</code>.
213
<div class=categorybox>
216
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
218
<a href="maxima_93.html#Category_003a-Syntax">Syntax</a>
223
<p><a name="Item_003a-nofix"></a>
213
225
<a name="nofix"></a>
214
226
<a name="SEC14"></a>
215
227
<table cellpadding="1" cellspacing="1" border="0">
225
237
<td valign="middle" align="left"> </td>
226
238
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
227
239
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
228
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
240
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
229
241
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
231
243
<h2 class="section"> 5.2 nofix </h2>
234
246
corresponding function to be evaluated. For example, when one types
235
247
"exit;" to exit from a Maxima break, "exit" is behaving similar to a
236
248
<code>nofix</code> operator. The function <code>nofix("x")</code> is a syntax extension
237
function which declares x to be a <code>nofix</code> operator.
239
<p>See also <code>syntax</code>.
249
function which declares <code>x</code> to be a <code>nofix</code> operator.
251
<p>See also <code>Syntax</code>.
253
<div class=categorybox>
256
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
258
<a href="maxima_93.html#Category_003a-Syntax">Syntax</a>
263
<p><a name="Item_003a-postfix"></a>
242
265
<a name="postfix"></a>
243
266
<a name="SEC15"></a>
244
267
<table cellpadding="1" cellspacing="1" border="0">
254
277
<td valign="middle" align="left"> </td>
255
278
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
256
279
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
257
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
280
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
258
281
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
260
283
<h2 class="section"> 5.3 postfix </h2>
261
284
<p><code>postfix</code> operators like the <code>prefix</code> variety denote functions
262
285
of a single argument, but in this case the argument immediately
263
286
precedes an occurrence of the operator in the input string, e.g. 3! .
264
The <code>postfix("x")</code> function is a syntax extension function to declare x
287
The <code>postfix("x")</code> function is a syntax extension function to declare <code>x</code>
265
288
to be a <code>postfix</code> operator.
267
<p>See also <code>syntax</code>.
290
<p>See also <code>Syntax</code>.
292
<div class=categorybox>
295
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
297
<a href="maxima_93.html#Category_003a-Syntax">Syntax</a>
302
<p><a name="Item_003a-prefix"></a>
270
304
<a name="prefix"></a>
271
305
<a name="SEC16"></a>
272
306
<table cellpadding="1" cellspacing="1" border="0">
282
316
<td valign="middle" align="left"> </td>
283
317
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
284
318
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
285
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
319
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
286
320
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
288
322
<h2 class="section"> 5.4 prefix </h2>
289
323
<p>A <code>prefix</code> operator is one which signifies a function of one
290
324
argument, which argument immediately follows an occurrence of the
291
operator. <code>prefix("x")</code> is a syntax extension function to declare x to
325
operator. <code>prefix("x")</code> is a syntax extension function to declare <code>x</code> to
292
326
be a <code>prefix</code> operator.
294
<p>See also <code>syntax</code>.
328
<p>See also <code>Syntax</code>.
330
<div class=categorybox>
333
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
335
<a href="maxima_93.html#Category_003a-Syntax">Syntax</a>
340
<p><a name="Item_003a-Arithmetic-operators"></a>
297
342
<a name="Arithmetic-operators"></a>
298
343
<a name="SEC17"></a>
299
344
<table cellpadding="1" cellspacing="1" border="0">
309
354
<td valign="middle" align="left"> </td>
310
355
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
311
356
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
312
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
357
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
313
358
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
315
360
<h2 class="section"> 5.5 Arithmetic operators </h2>
362
<p><a name="Item_003a-_002b"></a>
318
364
<dt><u>Operator:</u> <b>+</b>
319
365
<a name="IDX56"></a>
333
379
<dd><p>The symbols <code>+</code> <code>*</code> <code>/</code> and <code>^</code> represent
334
380
addition, multiplication, division, and exponentiation, respectively.
335
The name of these operators are <code>"+"</code> <code>"*"</code> <code>"//"</code> and <code>"^"</code>,
381
The names of these operators are <code>"+"</code> <code>"*"</code> <code>"/"</code> and <code>"^"</code>,
336
382
which may appear where the name of a function or operator is required.
338
384
<p>The symbols <code>+</code> and <code>-</code> represent unary addition and negation, respectively,
346
392
<p>Division <code>a / b</code> is represented within Maxima as multiplication, <code>a * b^(- 1)</code>.
347
393
Expressions such as <code>a * b^(- 1)</code> are displayed as division.
348
Maxima recognizes <code>"//"</code> as the name of the division operator.
394
Maxima recognizes <code>"/"</code> as the name of the division operator.
350
396
<p>Addition and multiplication are n-ary, commutative operators.
351
397
Division and exponentiation are binary, noncommutative operators.
399
445
<p>Division and exponentiation are binary, noncommutative operators.
400
The names of these operators are <code>"//"</code> and <code>"^"</code>.
446
The names of these operators are <code>"/"</code> and <code>"^"</code>.
402
448
<pre class="example">(%i1) [a / b, a ^ b];
406
452
(%i2) [map (op, %), map (args, %)];
407
(%o2) [[//, ^], [[a, b], [a, b]]]
408
(%i3) [apply ("//", [a, b]), apply ("^", [a, b])];
453
(%o2) [[/, ^], [[a, b], [a, b]]]
454
(%i3) [apply ("/", [a, b]), apply ("^", [a, b])];
519
583
<td valign="middle" align="left"> </td>
520
584
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
521
585
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
522
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
586
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
523
587
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
525
589
<h2 class="section"> 5.6 Relational operators </h2>
591
<p><a name="Item_003a-_003c"></a>
528
593
<dt><u>Operator:</u> <b><</b>
529
594
<a name="IDX62"></a>
537
602
<dt><u>Operator:</u> <b>></b>
538
603
<a name="IDX65"></a>
605
<dd><p>The symbols <code><</code> <code><=</code> <code>>=</code> and <code>></code> represent
606
less than, less than or equal, greater than or equal, and greater than, respectively.
607
The names of these operators are <code>"<"</code> <code>"<="</code> <code>">="</code> and <code>">"</code>,
608
which may appear where the name of a function or operator is required.
610
<p>These relational operators are all binary operators;
611
constructs such as <code>a < b < c</code> are not recognized by Maxima.
613
<p>Relational expressions are evaluated to Boolean values
614
by the functions <code>is</code> and <code>maybe</code>,
615
and the programming constructs <code>if</code>, <code>while</code>, and <code>unless</code>.
616
Relational expressions are not otherwise evaluated or simplified to Boolean values,
617
although the arguments of relational expressions are evaluated
618
(when evaluation is not otherwise prevented by quotation).
620
<p>When a relational expression cannot be evaluated to <code>true</code> or <code>false</code>,
621
the behavior of <code>is</code> and <code>if</code> are governed by the global flag <code>prederror</code>.
622
When <code>prederror</code> is <code>true</code>,
623
<code>is</code> and <code>if</code> trigger an error.
624
When <code>prederror</code> is <code>false</code>,
625
<code>is</code> returns <code>unknown</code>,
626
and <code>if</code> returns a partially-evaluated conditional expression.
628
<p><code>maybe</code> always behaves as if <code>prederror</code> were <code>false</code>,
629
and <code>while</code> and <code>unless</code> always behave as if <code>prederror</code> were <code>true</code>.
631
<p>Relational operators do not distribute over lists or other aggregates.
633
<p>See also <code>=</code> <code>#</code> <code>equal</code> and <code>notequal</code>.
637
<p>Relational expressions are evaluated to Boolean values by some functions and programming constructs.
639
<pre class="example">(%i1) [x, y, z] : [123, 456, 789];
640
(%o1) [123, 456, 789]
643
(%i3) maybe (y > z);
645
(%i4) if x >= z then 1 else 0;
647
(%i5) block ([S], S : 0, for i:1 while i <= 100 do S : S + i, return (S));
650
<p>Relational expressions are not otherwise evaluated or simplified to Boolean values,
651
although the arguments of relational expressions are evaluated.
653
<pre class="example">(%o1) [123, 456, 789]
654
(%i2) [x < y, y <= z, z >= y, y > z];
655
(%o2) [123 < 456, 456 <= 789, 789 >= 456, 456 > 789]
657
(%o3) [true, true, true, false]
659
<div class=categorybox>
662
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
668
<p><a name="Item_003a-General-operators"></a>
543
670
<a name="General-operators"></a>
544
671
<a name="SEC19"></a>
545
672
<table cellpadding="1" cellspacing="1" border="0">
555
682
<td valign="middle" align="left"> </td>
556
683
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
557
684
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
558
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
685
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
559
686
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
561
688
<h2 class="section"> 5.7 General operators </h2>
690
<p><a name="Item_003a-_005e_005e"></a>
564
692
<dt><u>Operator:</u> <b>^^</b>
565
693
<a name="IDX66"></a>
664
812
<p>For an argument <code>n</code> which is not an integer, float, or rational,
665
813
<code>n!!</code> yields a noun form <code>genfact (n, n/2, 2)</code>.
815
<div class=categorybox>
818
<p>Categories: <a href="maxima_93.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
820
<a href="maxima_93.html#Category_003a-Operators">Operators</a>
827
<p><a name="Item_003a-_0023"></a>
670
829
<dt><u>Operator:</u> <b>#</b>
671
830
<a name="IDX69"></a>
692
851
(%i6) is (not a = b);
854
<div class=categorybox>
857
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
864
<p><a name="Item_003a-_002e"></a>
698
866
<dt><u>Operator:</u> <b>.</b>
699
867
<a name="IDX70"></a>
701
869
<dd><p>The dot operator, for matrix (non-commutative) multiplication.
702
When "." is used in this way, spaces should be left on both sides of
703
it, e.g. A . B. This distinguishes it plainly from a decimal point in
870
When <code>"."</code> is used in this way, spaces should be left on both sides of
871
it, e.g. <code>A . B</code>. This distinguishes it plainly from a decimal point in
704
872
a floating point number.
717
885
<code>dotscrules</code>.
887
<div class=categorybox>
890
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
897
<p><a name="Item_003a-_003a"></a>
722
899
<dt><u>Operator:</u> <b>:</b>
723
900
<a name="IDX71"></a>
725
<dd><p>The assignment operator. E.g. A:3 sets the variable A to 3.
902
<dd><p>Assignment operator.
904
<p>When the left-hand side is a simple variable (not subscripted),
905
<code>:</code> evaluates its right-hand side
906
and associates that value with the left-hand side.
908
<p>When the left-hand side is a subscripted element of a list, matrix, declared Maxima array, or Lisp array,
909
the right-hand side is assigned to that element.
910
The subscript must name an existing element;
911
such objects cannot be extended by naming nonexistent elements.
913
<p>When the left-hand side is a subscripted element of an undeclared Maxima array,
914
the right-hand side is assigned to that element, if it already exists,
915
or a new element is allocated, if it does not already exist.
917
<p>When the left-hand side is a list of simple and/or subscripted variables,
918
the right-hand side must evaluate to a list,
919
and the elements of the right-hand side are assigned to the elements of the left-hand side,
922
<p>See also <code>kill</code> and <code>remvalue</code>,
923
which undo the association between the left-hand side and its value.
927
<p>Assignment to a simple variable.
929
<pre class="example">(%i1) a;
936
<p>Assignment to an element of a list.
938
<pre class="example">(%i1) b : [1, 2, 3];
945
<p>Assignment creates an undeclared array.
947
<pre class="example">(%i1) c[99] : 789;
954
(%o4) [hashed, 1, [99]]
958
<p>Multiple assignment.
960
<pre class="example">(%i1) [a, b, c] : [45, 67, 89];
969
<p>Multiple assignment is carried out in parallel.
970
The values of <code>a</code> and <code>b</code> are exchanged in this example.
972
<pre class="example">(%i1) [a, b] : [33, 55];
974
(%i2) [a, b] : [b, a];
981
<div class=categorybox>
984
<p>Categories: <a href="maxima_93.html#Category_003a-Evaluation">Evaluation</a>
986
<a href="maxima_93.html#Category_003a-Operators">Operators</a>
992
<p><a name="Item_003a-_003a_003a"></a>
730
994
<dt><u>Operator:</u> <b>::</b>
731
995
<a name="IDX72"></a>
733
<dd><p>Assignment operator. :: assigns the value of the expression
734
on its right to the value of the quantity on its left, which must
735
evaluate to an atomic variable or subscripted variable.
997
<dd><p>Assignment operator.
999
<p><code>::</code> is the same as <code>:</code> (which see)
1000
except that <code>::</code> evaluates its left-hand side as well as its right-hand side.
1004
<pre class="example">(%i1) x : 'foo;
1010
(%i4) x : '[a, b, c];
1012
(%i5) x :: [11, 22, 33];
1021
<div class=categorybox>
1024
<p>Categories: <a href="maxima_93.html#Category_003a-Evaluation">Evaluation</a>
1026
<a href="maxima_93.html#Category_003a-Operators">Operators</a>
1032
<p><a name="Item_003a-_003a_003a_003d"></a>
740
1034
<dt><u>Operator:</u> <b>::=</b>
741
1035
<a name="IDX73"></a>
848
1153
<p>All function definitions appear in the same namespace;
849
1154
defining a function <code>f</code> within another function <code>g</code>
850
does not limit the scope of <code>f</code> to <code>g</code>.
1155
does not automatically limit the scope of <code>f</code> to <code>g</code>.
1156
However, <code>local(f)</code> makes the definition of function <code>f</code>
1157
effective only within the block or other compound expression in which <code>local</code> appears.
852
1159
<p>If some formal argument <var>x_k</var> is a quoted symbol,
853
1160
the function defined by <code>:=</code> does not evaluate the corresponding actual argument.
886
1193
(%i2) H (a, b, c);
1196
<p><code>local</code> makes a local function definition.
1198
<pre class="example">(%i1) foo (x) := 1 - x;
1199
(%o1) foo(x) := 1 - x
1202
(%i3) block (local (foo), foo (x) := 2 * x, foo (100));
1207
<div class=categorybox>
1210
<p>Categories: <a href="maxima_93.html#Category_003a-Function-definition">Function definition</a>
1212
<a href="maxima_93.html#Category_003a-Operators">Operators</a>
1219
<p><a name="Item_003a-_003d"></a>
892
1221
<dt><u>Operator:</u> <b>=</b>
893
1222
<a name="IDX75"></a>
1058
1414
Otherwise, operands which do not evaluate to <code>true</code> or <code>false</code> are accepted,
1059
1415
and the result is a Boolean expression.
1417
<div class=categorybox>
1420
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
1427
<p><a name="Item_003a-abs"></a>
1064
1429
<dt><u>Function:</u> <b>abs</b><i> (<var>expr</var>)</i>
1065
1430
<a name="IDX79"></a>
1067
1432
<dd><p>Returns the absolute value <var>expr</var>. If <var>expr</var> is complex, returns the complex
1068
1433
modulus of <var>expr</var>.
1435
<div class=categorybox>
1438
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
1444
<p><a name="Item_003a-additive"></a>
1073
1446
<dt><u>Keyword:</u> <b>additive</b>
1074
1447
<a name="IDX80"></a>
1130
1514
<code>symmetric</code> or <code>commutative</code>, where n is the number of interchanges of two
1131
1515
arguments necessary to convert it to that form.
1517
<div class=categorybox>
1520
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
1522
<a href="maxima_93.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
1528
<p><a name="Item_003a-cabs"></a>
1136
1530
<dt><u>Function:</u> <b>cabs</b><i> (<var>expr</var>)</i>
1137
1531
<a name="IDX83"></a>
1139
1533
<dd><p>Returns the complex absolute value (the complex modulus) of
1140
1534
<var>expr</var>.
1536
<div class=categorybox>
1539
<p>Categories: <a href="maxima_93.html#Category_003a-Complex-variables">Complex variables</a>
1545
<p><a name="Item_003a-ceiling"></a>
1145
1547
<dt><u>Function:</u> <b>ceiling</b><i> (<var>x</var>)</i>
1146
1548
<a name="IDX84"></a>
1219
1637
simplifier that <code>h</code> is a commutative function. E.g. <code>h(x,z,y)</code> will
1220
1638
simplify to <code>h(x, y, z)</code>. This is the same as <code>symmetric</code>.
1640
<div class=categorybox>
1643
<p>Categories: <a href="maxima_93.html#Category_003a-Operators">Operators</a>
1645
<a href="maxima_93.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
1651
<p><a name="Item_003a-compare"></a>
1225
1653
<dt><u>Function:</u> <b>compare</b><i> (<var>x</var>, <var>y</var>)</i>
1226
1654
<a name="IDX87"></a>
1228
1656
<dd><p>Return a comparison operator <var>op</var>
1229
1657
(<code><</code>, <code><=</code>, <code>></code>, <code>>=</code>, <code>=</code>, or <code>#</code>) such that
1230
<code>is (<var>x</var> <var>op</var> <var>y</var>)</code> evaluates to true;
1658
<code>is (<var>x</var> <var>op</var> <var>y</var>)</code> evaluates to <code>true</code>;
1231
1659
when either <var>x</var> or <var>y</var> depends on <code>%i</code> and
1232
1660
<code><var>x</var> # <var>y</var></code>, return <code>notcomparable</code>;
1233
1661
when there is no such operator or
1257
1685
<p>The real domain of <code>acos (x^2 + 1)</code> is empty.
1687
<div class=categorybox>
1690
<p>Categories: <a href="maxima_93.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
1696
<p><a name="Item_003a-entier"></a>
1262
1698
<dt><u>Function:</u> <b>entier</b><i> (<var>x</var>)</i>
1263
1699
<a name="IDX88"></a>
1265
1701
<dd><p>Returns the largest integer less than or equal to <var>x</var> where <var>x</var> is numeric. <code>fix</code> (as in
1266
1702
<code>fixnum</code>) is a synonym for this, so <code>fix(<var>x</var>)</code> is precisely the same.
1704
<div class=categorybox>
1707
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
1713
<p><a name="Item_003a-equal"></a>
1271
1715
<dt><u>Function:</u> <b>equal</b><i> (<var>a</var>, <var>b</var>)</i>
1272
1716
<a name="IDX89"></a>
1382
1835
<p>If <var>x</var> is a constant expression (<code>10 * %pi</code>, for example),
1383
1836
<code>floor</code> evaluates <var>x</var> using big floating point numbers, and
1384
applies floor to the resulting big float. Because floor uses
1837
applies <code>floor</code> to the resulting big float. Because <code>floor</code> uses
1385
1838
floating point evaluation, it's possible, although unlikely,
1386
1839
that <code>floor</code> could return an erroneous value for constant
1387
1840
inputs. To guard against errors, the floating point evaluation
1460
1930
<code>eval</code> causes an extra evaluation of <var>expr</var>.
1461
1931
See <code>ev</code>.
1933
<div class=categorybox>
1936
<p>Categories: <a href="maxima_93.html#Category_003a-Evaluation-flags">Evaluation flags</a>
1942
<p><a name="Item_003a-evenp"></a>
1466
1944
<dt><u>Function:</u> <b>evenp</b><i> (<var>expr</var>)</i>
1467
1945
<a name="IDX93"></a>
1469
1947
<dd><p>Returns <code>true</code> if <var>expr</var> is an even integer.
1470
1948
<code>false</code> is returned in all other cases.
1950
<div class=categorybox>
1953
<p>Categories: <a href="maxima_93.html#Category_003a-Predicate-functions">Predicate functions</a>
1959
<p><a name="Item_003a-fix"></a>
1475
1961
<dt><u>Function:</u> <b>fix</b><i> (<var>x</var>)</i>
1476
1962
<a name="IDX94"></a>
1478
1964
<dd><p>A synonym for <code>entier (<var>x</var>)</code>.
1966
<div class=categorybox>
1969
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
1975
<p><a name="Item_003a-fullmap"></a>
1483
1977
<dt><u>Function:</u> <b>fullmap</b><i> (<var>f</var>, <var>expr_1</var>, ...)</i>
1484
1978
<a name="IDX95"></a>
1515
2019
<pre class="example">(%i1) fullmapl ("+", [3, [4, 5]], [[a, 1], [0, -1.5]]);
1516
2020
(%o1) [[a + 3, 4], [4, 3.5]]
2022
<div class=categorybox>
2025
<p>Categories: <a href="maxima_93.html#Category_003a-Function-application">Function application</a>
2027
<a href="maxima_93.html#Category_003a-Expressions">Expressions</a>
2033
<p><a name="Item_003a-is"></a>
1521
2035
<dt><u>Function:</u> <b>is</b><i> (<var>expr</var>)</i>
1522
2036
<a name="IDX97"></a>
1610
2144
of the absolute value of <var>x</var>,
1611
2145
which is an integer.
2147
<div class=categorybox>
2150
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2156
<p><a name="Item_003a-lmax"></a>
1616
2158
<dt><u>Function:</u> <b>lmax</b><i> (<var>L</var>)</i>
1617
2159
<a name="IDX100"></a>
1619
2161
<dd><p>When <var>L</var> is a list or a set, return <code>apply ('max, args (<var>L</var>))</code>. When <var>L</var> isn't a
1620
2162
list or a set, signal an error.
2164
<div class=categorybox>
2167
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2169
<a href="maxima_93.html#Category_003a-Lists">Lists</a>
2171
<a href="maxima_93.html#Category_003a-Sets">Sets</a>
2177
<p><a name="Item_003a-lmin"></a>
1625
2179
<dt><u>Function:</u> <b>lmin</b><i> (<var>L</var>)</i>
1626
2180
<a name="IDX101"></a>
1628
2182
<dd><p>When <var>L</var> is a list or a set, return <code>apply ('min, args (<var>L</var>))</code>. When <var>L</var> isn't a
1629
2183
list or a set, signal an error.
2185
<div class=categorybox>
2188
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2190
<a href="maxima_93.html#Category_003a-Lists">Lists</a>
2192
<a href="maxima_93.html#Category_003a-Sets">Sets</a>
2198
<p><a name="Item_003a-max"></a>
1634
2200
<dt><u>Function:</u> <b>max</b><i> (<var>x_1</var>, ..., <var>x_n</var>)</i>
1635
2201
<a name="IDX102"></a>
1641
2207
<code>max (x, 2*x, 3*x) --> max (x, 3*x)</code>. To set the value of <code>trylevel</code> to 2, use
1642
2208
<code>put (trylevel, 2, maxmin)</code>.
2210
<div class=categorybox>
2213
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2219
<p><a name="Item_003a-min"></a>
1647
2221
<dt><u>Function:</u> <b>min</b><i> (<var>x_1</var>, ..., <var>x_n</var>)</i>
1648
2222
<a name="IDX103"></a>
1654
2228
<code>min (x, 2*x, 3*x) --> min (x, 3*x)</code>. To set the value of <code>trylevel</code> to 2, use
1655
2229
<code>put (trylevel, 2, maxmin)</code>.
2231
<div class=categorybox>
2234
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2240
<p><a name="Item_003a-polymod"></a>
1660
2242
<dt><u>Function:</u> <b>polymod</b><i> (<var>p</var>)</i>
1661
2243
<a name="IDX104"></a>
1705
2295
(%i3) mod (0, x);
2298
<div class=categorybox>
2301
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2307
<p><a name="Item_003a-oddp"></a>
1711
2309
<dt><u>Function:</u> <b>oddp</b><i> (<var>expr</var>)</i>
1712
2310
<a name="IDX107"></a>
1714
2312
<dd><p>is <code>true</code> if <var>expr</var> is an odd integer.
1715
2313
<code>false</code> is returned in all other cases.
2315
<div class=categorybox>
2318
<p>Categories: <a href="maxima_93.html#Category_003a-Predicate-functions">Predicate functions</a>
2324
<p><a name="Item_003a-pred"></a>
1720
2326
<dt><u>Operator:</u> <b>pred</b>
1721
2327
<a name="IDX108"></a>
2534
<div class=categorybox>
2537
<p>Categories: <a href="maxima_93.html#Category_003a-Numerical-evaluation">Numerical evaluation</a>
2543
<p><a name="Item_003a-round"></a>
2545
<dt><u>Function:</u> <b>round</b><i> (<var>x</var>)</i>
2546
<a name="IDX116"></a>
2548
<dd><p>When <var>x</var> is a real number, returns the closest integer
2549
to <var>x</var>. Multiples of 1/2 are rounded to the nearest
2550
even integer. Evaluation of <var>x</var> is similar to
2551
<code>floor</code> and <code>ceiling</code>.
2553
<div class=categorybox>
2556
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2563
<p><a name="Item_003a-sign"></a>
1896
2565
<dt><u>Function:</u> <b>sign</b><i> (<var>expr</var>)</i>
1897
<a name="IDX116"></a>
2566
<a name="IDX117"></a>
1899
2568
<dd><p>Attempts to determine the sign of <var>expr</var>
1900
2569
on the basis of the facts in the current data base. It returns one of
1902
2571
(positive or zero), <code>nz</code> (negative or zero), <code>pn</code> (positive or negative),
1903
2572
or <code>pnz</code> (positive, negative, or zero, i.e. nothing known).
2574
<div class=categorybox>
2577
<p>Categories: <a href="maxima_93.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
2583
<p><a name="Item_003a-signum"></a>
1908
2585
<dt><u>Function:</u> <b>signum</b><i> (<var>x</var>)</i>
1909
<a name="IDX117"></a>
2586
<a name="IDX118"></a>
1911
2588
<dd><p>For numeric <var>x</var>, returns 0 if <var>x</var> is 0, otherwise returns -1 or +1
1912
2589
as <var>x</var> is less than or greater than 0, respectively.
1914
2591
<p>If <var>x</var> is not numeric then a simplified but equivalent form is returned.
1915
2592
For example, <code>signum(-x)</code> gives <code>-signum(x)</code>.
2594
<div class=categorybox>
2597
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2603
<p><a name="Item_003a-sort"></a>
1920
2605
<dt><u>Function:</u> <b>sort</b><i> (<var>L</var>, <var>P</var>)</i>
1921
<a name="IDX118"></a>
2606
<a name="IDX119"></a>
1923
2608
<dt><u>Function:</u> <b>sort</b><i> (<var>L</var>)</i>
1924
<a name="IDX119"></a>
2609
<a name="IDX120"></a>
1926
2611
<dd><p>Sorts a list <var>L</var> according to a predicate <code>P</code> of two arguments,
1927
2612
such that <code><var>P</var> (<var>L</var>[k], <var>L</var>[k + 1])</code> is <code>true</code>
1973
2658
reverse (b))));
1974
2659
(%o7) [[%pi, %e], [ee, cc], [zz, xx, mm, cc], [aa, hh, uu]]
2661
<div class=categorybox>
2664
<p>Categories: <a href="maxima_93.html#Category_003a-Lists">Lists</a>
2670
<p><a name="Item_003a-sqrt"></a>
1979
2672
<dt><u>Function:</u> <b>sqrt</b><i> (<var>x</var>)</i>
1980
<a name="IDX120"></a>
2673
<a name="IDX121"></a>
1982
2675
<dd><p>The square root of <var>x</var>. It is represented internally by
1983
2676
<code><var>x</var>^(1/2)</code>. See also <code>rootscontract</code>.
1986
2679
which are powers of n to be pulled outside of the radical, e.g.
1987
2680
<code>sqrt(16*x^2)</code> will become <code>4*x</code> only if <code>radexpand</code> is <code>true</code>.
2682
<div class=categorybox>
2685
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2691
<p><a name="Item_003a-sqrtdispflag"></a>
1992
2693
<dt><u>Option variable:</u> <b>sqrtdispflag</b>
1993
<a name="IDX121"></a>
2694
<a name="IDX122"></a>
1995
2696
<dd><p>Default value: <code>true</code>
1997
2698
<p>When <code>sqrtdispflag</code> is <code>false</code>,
1998
2699
causes <code>sqrt</code> to display with exponent 1/2.
2701
<div class=categorybox>
2704
<p>Categories: <a href="maxima_93.html#Category_003a-Mathematical-functions">Mathematical functions</a>
2706
<a href="maxima_93.html#Category_003a-Display-flags-and-variables">Display flags and variables</a>
2713
<p><a name="Item_003a-sublis"></a>
2003
2715
<dt><u>Function:</u> <b>sublis</b><i> (<var>list</var>, <var>expr</var>)</i>
2004
<a name="IDX122"></a>
2716
<a name="IDX123"></a>
2006
2718
<dd><p>Makes multiple parallel substitutions into an expression.
2029
2749
(%i2) sublist (L, evenp);
2030
2750
(%o2) [2, 4, 6]
2752
<div class=categorybox>
2755
<p>Categories: <a href="maxima_93.html#Category_003a-Lists">Lists</a>
2761
<p><a name="Item_003a-sublis_005fapply_005flambda"></a>
2035
2763
<dt><u>Option variable:</u> <b>sublis_apply_lambda</b>
2036
<a name="IDX124"></a>
2764
<a name="IDX125"></a>
2038
<dd><p>Default value: <code>true</code> - controls whether <code>lambda</code>'s
2766
<dd><p>Default value: <code>true</code>
2768
<p>Controls whether <code>lambda</code>'s
2039
2769
substituted are applied in simplification after <code>sublis</code> is used or
2040
2770
whether you have to do an <code>ev</code> to get things to apply. <code>true</code> means do the
2773
<div class=categorybox>
2776
<p>Categories: <a href="maxima_93.html#Category_003a-Expressions">Expressions</a>
2783
<p><a name="Item_003a-subst"></a>
2046
2785
<dt><u>Function:</u> <b>subst</b><i> (<var>a</var>, <var>b</var>, <var>c</var>)</i>
2047
<a name="IDX125"></a>
2786
<a name="IDX126"></a>
2049
2788
<dd><p>Substitutes <var>a</var> for <var>b</var> in <var>c</var>. <var>b</var> must be an atom or a
2050
2789
complete subexpression of <var>c</var>. For example, <code>x+y+z</code> is a complete
2085
2824
<p>For further examples, do <code>example (subst)</code>.
2826
<div class=categorybox>
2829
<p>Categories: <a href="maxima_93.html#Category_003a-Expressions">Expressions</a>
2835
<p><a name="Item_003a-substinpart"></a>
2090
2837
<dt><u>Function:</u> <b>substinpart</b><i> (<var>x</var>, <var>expr</var>, <var>n_1</var>, ..., <var>n_k</var>)</i>
2091
<a name="IDX126"></a>
2838
<a name="IDX127"></a>
2093
2840
<dd><p>Similar to <code>substpart</code>, but <code>substinpart</code> works on the
2094
2841
internal representation of <var>expr</var>.
2144
2891
<p>Also, setting the option <code>inflag</code> to <code>true</code> and calling <code>part</code> or <code>substpart</code> is
2145
2892
the same as calling <code>inpart</code> or <code>substinpart</code>.
2894
<div class=categorybox>
2897
<p>Categories: <a href="maxima_93.html#Category_003a-Expressions">Expressions</a>
2903
<p><a name="Item_003a-substpart"></a>
2150
2905
<dt><u>Function:</u> <b>substpart</b><i> (<var>x</var>, <var>expr</var>, <var>n_1</var>, ..., <var>n_k</var>)</i>
2151
<a name="IDX127"></a>
2906
<a name="IDX128"></a>
2153
2908
<dd><p>Substitutes <var>x</var> for the subexpression
2154
2909
picked out by the rest of the arguments as in <code>part</code>. It returns the
2174
2929
<p>Also, setting the option <code>inflag</code> to <code>true</code> and calling <code>part</code> or <code>substpart</code> is
2175
2930
the same as calling <code>inpart</code> or <code>substinpart</code>.
2932
<div class=categorybox>
2935
<p>Categories: <a href="maxima_93.html#Category_003a-Expressions">Expressions</a>
2941
<p><a name="Item_003a-subvarp"></a>
2180
2943
<dt><u>Function:</u> <b>subvarp</b><i> (<var>expr</var>)</i>
2181
<a name="IDX128"></a>
2944
<a name="IDX129"></a>
2183
2946
<dd><p>Returns <code>true</code> if <var>expr</var> is a subscripted variable, for example
2184
2947
<code>a[i]</code>.
2949
<div class=categorybox>
2952
<p>Categories: <a href="maxima_93.html#Category_003a-Predicate-functions">Predicate functions</a>
2958
<p><a name="Item_003a-symbolp"></a>
2189
2960
<dt><u>Function:</u> <b>symbolp</b><i> (<var>expr</var>)</i>
2190
<a name="IDX129"></a>
2961
<a name="IDX130"></a>
2192
2963
<dd><p>Returns <code>true</code> if <var>expr</var> is a symbol, else <code>false</code>.
2193
2964
In effect, <code>symbolp(x)</code> is equivalent to the predicate <code>atom(x) and not numberp(x)</code>.
2195
<p>See also <a href="maxima_6.html#SEC25">Identifiers</a>.
2966
<p>See also <a href="maxima_6.html#SEC24">Identifiers</a>.
2968
<div class=categorybox>
2971
<p>Categories: <a href="maxima_93.html#Category_003a-Predicate-functions">Predicate functions</a>
2977
<p><a name="Item_003a-unorder"></a>
2200
2979
<dt><u>Function:</u> <b>unorder</b><i> ()</i>
2201
<a name="IDX130"></a>
2980
<a name="IDX131"></a>
2203
2982
<dd><p>Disables the aliasing created by the last use of the ordering
2204
2983
commands <code>ordergreat</code> and <code>orderless</code>. <code>ordergreat</code> and <code>orderless</code> may not
2298
3101
On the other hand <code>zeroequiv (log(a*b) - log(a) - log(b), a)</code> returns <code>dontknow</code> because
2299
3102
of the presence of an extra parameter <code>b</code>.
3104
<div class=categorybox>
3107
<p>Categories: <a href="maxima_93.html#Category_003a-Predicate-functions">Predicate functions</a>
3113
<p><a name="Item_003a-Expressions"></a>
2304
3115
<table cellpadding="1" cellspacing="1" border="0">
2305
3116
<tr><td valign="middle" align="left">[<a href="#SEC12" title="Beginning of this chapter or previous chapter"> << </a>]</td>
2306
3117
<td valign="middle" align="left">[<a href="maxima_6.html#SEC20" title="Next chapter"> >> </a>]</td>
2311
3122
<td valign="middle" align="left"> </td>
2312
3123
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
2313
3124
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
2314
<td valign="middle" align="left">[<a href="maxima_77.html#SEC300" title="Index">Index</a>]</td>
3125
<td valign="middle" align="left">[<a href="maxima_79.html#SEC320" title="Index">Index</a>]</td>
2315
3126
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
2318
3129
<font size="-1">
2319
This document was generated by <em>Robert Dodier</em> on <em>August, 25 2007</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
3130
This document was generated by <em>Robert Dodier</em> on <em>December, 14 2008</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.