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

◆ TEST() [4/7]

TEST ( ARingRRi ,
multDivide  )

Definition at line 182 of file ARingRRiTest.cpp.

183{
184 M2::ARingRRi R(100);
186 M2::ARingRRi::ElementType a, b, c, d;
187 R.init(a);
188 R.init(b);
189 R.init(c);
190 R.init(d);
191 for (int i = 0; i < ntrials; i++)
192 {
193 // test: (a*b) // b == a
194 gen.nextElement(a);
195 gen.nextElement(b);
196 R.mult(c, a, b);
197 if (R.is_member(0L,b))
198 EXPECT_TRUE(R.is_member(0L,c));
199 else
200 {
201 R.divide(d, c, b);
202 EXPECT_TRUE(R.is_subset(a,d));
203 }
204 }
205 R.clear(d);
206 R.clear(c);
207 R.clear(b);
208 R.clear(a);
209}
const int ntrials
Definition ARingTest.hpp:42
aring-style adapter for arbitrary-precision real intervals, backed by MPFI.
Definition aring-RRi.hpp:69

References M2::ARingRRi::clear(), M2::ARingRRi::divide(), M2::ARingRRi::init(), M2::ARingRRi::is_member(), M2::ARingRRi::is_subset(), M2::ARingRRi::mult(), ARingElementGenerator< RingType >::nextElement(), and ntrials.