title: Modulo Arithmetic in Java, Android problem
body: <p>I can't figure this out at all. I did:</p>
  
  <pre><code>int num = ((month-1)*30+day)%134;
                //a,b,c are just for the Log
          String a = String.valueOf(num);
          String b = String.valueOf(month);
          String c = String.valueOf(day);
  
          Log.v("variables",a+","+b+","+c);
          num ++;// don't want zero
          String stringnum = String.valueOf(num);
          Log.v("Index",stringnum);
  </code></pre>
  
  <p>month is todays month, day is today (i.e. december 31st = 12,31). In ANdroid this is taken from CALENDAR.
  Now this program was working fine until today. Jan 1st. What happens is the DB searches for a string of index num, taken from the date. The problem isnt in the DB, its in this code. 
  Jan 1st is month=0, day = 1, naturally, but after mod 134 I get, courtesy of LogCat:</p>
  
  <pre><code>01-01 12:07:38.554: VERBOSE/variables(6917): -29,0,1
  </code></pre>
  
  <p>But 1mod134 != -29. I can't understand where  -29 comes from.</p>