up previous next
RingQQ

the ring of rationals

Syntax
RingQQ(): RING

Description
This function returns the ring of rationals. It is particularly useful when you want to use QQ (which is a pre-defined top-level variable) inside a function.

NOTE: calling RingQQ twice gives the same identical ring, whereas calling NewPolyRing and NewFractionField return each time a new ring.

Example
/**/  QQ = RingQQ();

/**/  Two := RingElem(RingQQ(), 2);   Two;
2
/**/  type(Two);
RINGELEM;
/**/  IsQQ(RingOf(Two));
true

See Also