title: checking if a division gives remainder 0
body: <p>hi i am writing an arduino program and i must check if a variable divided by 60 gives remainder 0. This variable is increased by 1 each second. I tried to write </p>
  
  <pre><code>if (variable % 60 == 0){
  ...
  }
  </code></pre>
  
  <p>but it work even if the variable is 3, 6, 9...</p>
  
  <p>my exact code is:</p>
  
  <pre><code>    if (millis()/1000 != prevsec){
      prevsec = millis()/1000;
      if (millis() % 60 == 0){
        Serial.print("light");
    Serial.println(analogRead(0));
    tempC = analogRead(1);           //read the value from the sensor
    tempC = (5.0 * tempC * 100.0)/1024.0;  //convert the analog data to temperature
    Serial.print("tempin");
    Serial.println((byte)tempC); 
      }
      Serial.println(millis()/1000);
    }
  </code></pre>
  
  <p>Please tell me what i am doing wrong
  thanks in advance!</p>