[top][index]
search for:

basic rings

The following rings are initially present in every session with Macaulay 2.

  • ZZ -- the class of all integers
  • QQ -- the class of all rational numbers
  • RR -- the class of all real numbers
  • CC -- the class of all complex numbers
  • (The names of these rings are double letters so the corresponding symbols with single letters can be used as variables in rings.) Entries of these rings are constructed as follows, and the usual arithmetic operations apply.

    i1 : 1234

    o1 = 1234
    i2 : 123/4

         123
    o2 = ---
          4

    o2 : QQ
    i3 : 123.4

    o3 = 123.4

    o3 : RR
    i4 : 123+4*ii

    o4 = 123 + 4ii

    o4 : CC

    The usual arithmetic operations are available.

    i5 : 4/5 + 2/3

         22
    o5 = --
         15

    o5 : QQ
    i6 : 10^20

    o6 = 100000000000000000000
    i7 : 3*5*7

    o7 = 105
    i8 : 5!

    o8 = 120

    An additional pair of division operations that produce integral quotients and remainders is available.

    i9 : 1234//100

    o9 = 12
    i10 : 1234%100

    o10 = 34


    [top][index]
    search for: