next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc > rings > basic rings of numbers

basic rings of numbers

The following rings are initially present in every session with Macaulay2. The names of some of these rings are double letters so the corresponding symbols with single letters are preserved for use as variables.

Numbers in these rings are constructed as follows.

1234
123/4
123.4
1.234e-20
123+4*ii
The usual arithmetic operations are available.
4/5 + 2/3
10^20
3*5*7
3.1^2.1
sqrt 3.
An additional pair of division operations that produce integer quotients and remainders is available.
1234//100
1234%100
Numbers can be promoted to larger rings as follows, see RingElement _ Ring.
1_QQ
(2/3)_CC
One way to enter real and complex numbers with more precision is to insert the desired number of bits of precision after the letter p at the end of the number, but before the possible e that indicates the exponent of 10.
1p300
1p300e-30
Numbers can be lifted to smaller rings as follows, see lift.
x = 2/3*ii/ii
lift(x,RR)
lift(x,QQ)