up previous next
2.2.1 Introduction to INT
|
There are two types of numbers recognized by CoCoA: integers (type
INT
), rationals (type
RAT
).
(CoCoA-4 also had
ZMOD
, but CoCoA-5 can deal with more rings:
see
NewRingFp
).
Numbers in CoCoA are handled with arbitrary precision. This means that the
sizes of numbers are only limited by the amount of available memory.
The basic numeric operations---addition (
+
), subtraction (
-
),
multiplication (
*
), division (
/
), exponentiation (
^
),
and negation (
-
)---behave as one would expect.
Be careful, two adjacent minus signs,
--
, start a comment in CoCoA.
/**/ N := 3;
/**/ -N;
-3
--N; <-- THIS IS A COMMENT (not C++ decrement)
|