title: modulus operator with unsigned chars
body: <p>Trying to get some code working and the modulus doesn't want to do what I want it to do... which means I have it wrong.</p>
  
  <p>I have <code>unsigned char</code>s that I'm trying to seperate out hours/minutes/seconds into so I can display them on the screen in Ascii.</p>
  
  <p>The variable <code>secs</code> is an<code>unsigned int</code>.  Everything else is an<code>unsigned char</code>. I want the results in <code>unsigned char</code>s so not to waste memory.  Working in an embedded environment.</p>
  
  <p>Anyone care to look at the code snippet and tell me what I've done wrong?</p>
  
  <pre><code>hours   = secs/3600.0;
  minutes =(secs/60.0)-(hours*3600);
  seconds =secs-(hours*3600)-(minutes*60);
  
  sec_ones    =(unsigned char)((seconds%10));
  sec_tens    =(unsigned char)((seconds-sec_ones)%100);
  min_ones    =(unsigned char)(minutes%10);
  min_tens    =(unsigned char)((minutes-min_ones)%100);
  hrs_ones    =(unsigned char)(hours%10);
  hrs_tens    =(unsigned char)((hours-hrs_ones)%100);
  </code></pre>