1: int zero = 0;
   2: int selfinv;
   3: int i;
   4: int j;
   5: int k;
   6: 
   7: main()
   8: {
   9:     selfinv = ~(((unsigned)~0) >> 1);
  10:     i = selfinv + 0101; /* neg */
  11:     j = selfinv - 0100; /* pos */
  12:     printf("everything should be true\n");
  13:     printf("selfinv = 0%o\n", selfinv);
  14:     printf("zero = %d\n", zero);
  15:     printf("i = 0%o = %d.\n", i, i);
  16:     printf("j = 0%o = %d.\n", j, j);
  17:     printf("j-i = 0%o = %d.\n", j - i);
  18:     printf("j - i < 0\t");
  19:     if ((j-i) < 0)
  20:         printf("true\n");
  21:     else
  22:         printf("false\n");
  23:     k = j - i;
  24:     printf("k=j-i; (k < 0)\t");
  25:     if (k < 0)
  26:         printf("true\n");
  27:     else
  28:         printf("false\n");
  29:     printf("j - i < zero\t");
  30:     if (j - i < zero)
  31:         printf("true\n");
  32:     else
  33:         printf("false\n");
  34:     printf("(j-i < 0) == (j - i < zero)\t");
  35:     if ((j-i < 0) == (j - i < zero))
  36:         printf("true\n");
  37:     else
  38:         printf("false\n");
  39: }

Defined functions

main defined in line 7; never used

Defined variables

i defined in line 3; used 9 times
j defined in line 4; used 9 times
k defined in line 5; used 2 times
selfinv defined in line 2; used 4 times
  • in line 9-13(4)
zero defined in line 1; used 3 times
Last modified: 1986-10-21
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1992
Valid CSS Valid XHTML 1.0 Strict