
A7.2 Comparison 155
A7.2.9 Operators
The following have a different symbol:
Gauss Ox
.*. **
/= !=
not !
and &&
or ||
The following Gauss operators are not
supported in Ox: % (Ox has the idiv
function) !*~.’.
For x! use exp(loggamma(x+1)) or
gammafact(x+1) in Ox.
The text form of the relational operators
are not available in Ox, so e.g. use .< in-
stead of .LT.
There are no special string versions of op-
erators in Ox.
The ^ operator is matrix power, not ele-
ment by element power.
And finally, x=A/b (with A and b con-
formable) does not solve a linear system,
but is executed as x=A*(1/b). This fails,
because intended is x=(1/A)*b.The1/A
part in Ox computes the generalized in-
verse if the normal inverse does not work.
A7.2.10 Loop statements
Gauss has the do while and do until
loop:
i=1;
do while (i <= 10);
/* something */
i=i+1;
endo;
i = 10;
do until (i < 1);
/* something */
i=i-1;
endo;
Recently a for loop statement has been
added to Gauss.
Ox has the for, while and do while loop
statements (note the difference in the use
of the semi-colon).
for (i = 0; i < 10; ++i)
{
/* something */
}
i = 10;
while (i >= 1)
{
/* something */
--i;
}
i=1;
do
{ /* something */
++i;
} while (i <= 10);
Komentarze do niniejszej Instrukcji