245{
247 typename T::ElementType a, b, c, d;
248 R.init(a);
249 R.init(b);
250 R.init(c);
251 R.init(d);
252 for (
int i = 0; i <
ntrials; i++)
253 {
254 gen.nextElement(a);
255 gen.nextElement(b);
256 R.add(c, a, b);
257 R.negate(d, b);
258
259#if 0
261 o << "a=";
262 R.elem_text_out(o, a , true, false, false);
263 o << " b=";
264 R.elem_text_out(o, b , true, false, false);
265 o << " a+b=";
266 R.elem_text_out(o, c , true, false, false);
267 o << " -b=";
268 R.elem_text_out(o, d , true, false, false);
269#endif
270
271 R.add(d, c, d);
272
273#if 0
274 o << " a=";
275 R.elem_text_out(o, d , true, false, false);
276 std::cout << o.
str() << std::endl;
277#endif
278 EXPECT_TRUE(R.is_equal(d, a));
279 }
280 R.clear(a);
281 R.clear(b);
282 R.clear(c);
283 R.clear(d);
284}