up previous next
2.2.1 Introduction to INT
There are two types of numbers recognized by CoCoA: integers (type
), rationals (type
(CoCoA-4 also had
, but CoCoA-5 can deal with more rings:
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 (
), division (
), exponentiation (
and negation (
)---behave as one would expect.
Be careful, two adjacent minus signs,
, start a comment in CoCoA.
/**/ N := 3;
--N; <-- THIS IS A COMMENT (not C++ decrement)