3 <!-- Created by texi2html 1.56k from cln.texi on 28 August 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="SEC48" HREF="cln_toc.html#TOC48">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>
47 <DT><CODE>cl_boolean R->equal (const cl_ring_element& x, const cl_ring_element& y)</CODE>
50 <DT><CODE>cl_ring_element R->zero ()</CODE>
53 <DT><CODE>cl_boolean R->zerop (const cl_ring_element& x)</CODE>
56 <DT><CODE>cl_ring_element R->plus (const cl_ring_element& x, const cl_ring_element& y)</CODE>
59 <DT><CODE>cl_ring_element R->minus (const cl_ring_element& x, const cl_ring_element& y)</CODE>
62 <DT><CODE>cl_ring_element R->uminus (const cl_ring_element& x)</CODE>
65 <DT><CODE>cl_ring_element R->one ()</CODE>
68 <DT><CODE>cl_ring_element R->canonhom (const cl_I& x)</CODE>
71 <DT><CODE>cl_ring_element R->mul (const cl_ring_element& x, const cl_ring_element& y)</CODE>
74 <DT><CODE>cl_ring_element R->square (const cl_ring_element& x)</CODE>
77 <DT><CODE>cl_ring_element R->expt_pos (const cl_ring_element& x, const cl_I& y)</CODE>
83 The following rings are built-in.
88 <DT><CODE>cl_null_ring cl_0_ring</CODE>
90 The null ring, containing only zero.
92 <DT><CODE>cl_complex_ring cl_C_ring</CODE>
94 The ring of complex numbers. This corresponds to the type <CODE>cl_N</CODE>.
96 <DT><CODE>cl_real_ring cl_R_ring</CODE>
98 The ring of real numbers. This corresponds to the type <CODE>cl_R</CODE>.
100 <DT><CODE>cl_rational_ring cl_RA_ring</CODE>
102 The ring of rational numbers. This corresponds to the type <CODE>cl_RA</CODE>.
104 <DT><CODE>cl_integer_ring cl_I_ring</CODE>
106 The ring of integers. This corresponds to the type <CODE>cl_I</CODE>.
110 Type tests can be performed for any of <CODE>cl_C_ring</CODE>, <CODE>cl_R_ring</CODE>,
111 <CODE>cl_RA_ring</CODE>, <CODE>cl_I_ring</CODE>:
116 <DT><CODE>cl_boolean instanceof (const cl_number& x, const cl_number_ring& R)</CODE>
118 <A NAME="IDX253"></A>
119 Tests whether the given number is an element of the number ring R.
123 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>.