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

◆ TEST() [6/24]

TEST ( ARingZZp ,
fromStream  )

Definition at line 157 of file ARingZZpTest.cpp.

158{
159 std::istringstream i("+1234 +345 -235*a");
160 M2::ARingZZp R(32003);
162 R.init(a);
163 while (true)
164 {
165 while (isspace(i.peek())) i.get();
166
167 if (!isdigit(i.peek()) && i.peek() != '+' && i.peek() != '-') break;
168
169 fromStream(i, R, a);
170
171 buffer o;
172 R.elem_text_out(o, a);
173 std::cout << o.str() << " peek: " << i.peek() << std::endl;
174 }
175 R.clear(a);
176}
std::istream & fromStream(std::istream &i, const T &R, typename T::ElementType &result)
aring-style adapter for Z/p using a discrete-log (Zech) representation: every non-zero residue is its...
Definition aring-zzp.hpp:67
char * str()
Definition buffer.hpp:72

References M2::ARingZZp::clear(), M2::ARingZZp::elem_text_out(), fromStream(), M2::ARingZZp::init(), and buffer::str().