3 <!-- Created by texi2html 1.56k from cln.texi on 4 May 2000 -->
5 <TITLE>CLN, a Class Library for Numbers - 6. Rings</TITLE>
8 Go to the <A HREF="cln_1.html">first</A>, <A HREF="cln_5.html">previous</A>, <A HREF="cln_7.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.
12 <H1><A NAME="SEC47" HREF="cln_toc.html#TOC47">6. Rings</A></H1>
15 CLN has a class of abstract rings.
26 Rings can be compared for equality:
31 <DT><CODE>bool operator== (const cl_ring&, const cl_ring&)</CODE>
33 <DT><CODE>bool operator!= (const cl_ring&, const cl_ring&)</CODE>
35 These compare two rings for equality.
39 Given a ring <CODE>R</CODE>, the following members can be used.
44 <DT><CODE>void R->fprint (cl_ostream stream, const cl_ring_element& x)</CODE>
46 <DT><CODE>cl_boolean R->equal (const cl_ring_element& x, const cl_ring_element& y)</CODE>
48 <DT><CODE>cl_ring_element R->zero ()</CODE>
50 <DT><CODE>cl_boolean R->zerop (const cl_ring_element& x)</CODE>
52 <DT><CODE>cl_ring_element R->plus (const cl_ring_element& x, const cl_ring_element& y)</CODE>
54 <DT><CODE>cl_ring_element R->minus (const cl_ring_element& x, const cl_ring_element& y)</CODE>
56 <DT><CODE>cl_ring_element R->uminus (const cl_ring_element& x)</CODE>
58 <DT><CODE>cl_ring_element R->one ()</CODE>
60 <DT><CODE>cl_ring_element R->canonhom (const cl_I& x)</CODE>
62 <DT><CODE>cl_ring_element R->mul (const cl_ring_element& x, const cl_ring_element& y)</CODE>
64 <DT><CODE>cl_ring_element R->square (const cl_ring_element& x)</CODE>
66 <DT><CODE>cl_ring_element R->expt_pos (const cl_ring_element& x, const cl_I& y)</CODE>
71 The following rings are built-in.
76 <DT><CODE>cl_null_ring cl_0_ring</CODE>
78 The null ring, containing only zero.
80 <DT><CODE>cl_complex_ring cl_C_ring</CODE>
82 The ring of complex numbers. This corresponds to the type <CODE>cl_N</CODE>.
84 <DT><CODE>cl_real_ring cl_R_ring</CODE>
86 The ring of real numbers. This corresponds to the type <CODE>cl_R</CODE>.
88 <DT><CODE>cl_rational_ring cl_RA_ring</CODE>
90 The ring of rational numbers. This corresponds to the type <CODE>cl_RA</CODE>.
92 <DT><CODE>cl_integer_ring cl_I_ring</CODE>
94 The ring of integers. This corresponds to the type <CODE>cl_I</CODE>.
98 Type tests can be performed for any of <CODE>cl_C_ring</CODE>, <CODE>cl_R_ring</CODE>,
99 <CODE>cl_RA_ring</CODE>, <CODE>cl_I_ring</CODE>:
104 <DT><CODE>cl_boolean instanceof (const cl_number& x, const cl_number_ring& R)</CODE>
106 Tests whether the given number is an element of the number ring R.
110 Go to the <A HREF="cln_1.html">first</A>, <A HREF="cln_5.html">previous</A>, <A HREF="cln_7.html">next</A>, <A HREF="cln_13.html">last</A> section, <A HREF="cln_toc.html">table of contents</A>.