% Remainder after division (modulo division)

The result of a modulo division is the remainder of an integer division of the given numbers. Examples

  //27 / 16 = 1, remainder 11
  x =  27 / 16;   //x is 1
  x =  27 % 16;   //x is 11

  my_variable_h = (uint8_t)(my_uint16_variable / 256);
  my_variable_l = (uint8_t)(my_uint16_variable % 256);
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *