x + y
x - y
x * y
x / y
The operators +
, -
, *
, and /
evaluate to the sum, difference,
product, and quotient of the two Gaussians x and y. Of course either
operand may also be an ordinary rational (see Rationals), because the
rationals are embedded into the Gaussian rationals. On the other hand
the Gaussian rationals are embedded into other cyclotomic fields, so
either operand may also be a cyclotomic (see Cyclotomics). Division by
0 is as usual an error.
x ^ n
The operator ^
evaluates to the n-th power of the Gaussian rational
x. If n is positive, the power is defined as the n-fold product
x*x*...x
; if n is negative, the power is defined as
(1/x)^(-n)
; and if n is zero, the power is 1, even if x is 0.
gap> (1 + E(4)) * (E(4) - 1); -2
GAP 3.4.4