]> www.ginac.de Git - cln.git/blob - tests/test_I_lognot.cc
* src/base/digitseq/cl_DS.h: #undef DS, needed for i386-Solaris.
[cln.git] / tests / test_I_lognot.cc
1 #include "test_I.h"
2
3 int test_I_lognot (int iterations)
4 {
5         int error = 0;
6         int i;
7         // Check involution, sign, and against "+".
8         for (i = iterations; i > 0; i--) {
9                 cl_I a = testrandom_I();
10                 cl_I b = lognot(a);
11                 ASSERT1(lognot(b) == a, a);
12                 ASSERT1(minusp(a) != minusp(b), a);
13                 ASSERT1(a+b == -1, a);
14         }
15         // Check special cases 0 and -1.
16         ASSERT(lognot(0) == -1);
17         return error;
18 }