Macaulay2 Engine
Loading...
Searching...
No Matches

◆ TEST() [19/19]

TEST ( RingZZmod32003 ,
fromStream  )

Definition at line 43 of file RingZZpTest.cpp.

44{
45 std::istringstream i("+1234 +345 -235*a");
46 Z_mod* R = Z_mod::create(32003);
47 ring_elem a;
48 while (fromStream(i, *R, a))
49 {
50 buffer o;
51 R->elem_text_out(o, a);
52 std::cout << o.str() << " peek: "
53 << "." << static_cast<char>(i.peek()) << "." << std::endl;
54 }
55}
std::istream & fromStream(std::istream &i, const T &R, typename T::ElementType &result)
virtual void elem_text_out(buffer &o, const ring_elem f, bool p_one=true, bool p_plus=false, bool p_parens=false) const
Definition ZZp.cpp:114
static Z_mod * create(int p)
Definition ZZp.cpp:64
Engine-side Z/p ring for small primes (p < 32767), using a discrete-log (Zech) representation.
Definition ZZp.hpp:63
char * str()
Definition buffer.hpp:72

References Z_mod::create(), Z_mod::elem_text_out(), fromStream(), and buffer::str().