Hi I need to know how the equation below works.
So I have a number line 0 to 21 each cell is divided into 3 units so 0-2 belongs to first unit, 3-5 belongs to the second unit and so on. This 3 unit cell is further divided into 2 unit cells. So what you want to determine is given a number within this line, which 2 unit block this number belongs to.
Example, if you have 10 10/3=3.333.... and so we know that 10 belongs to the 3rd block and now we need to determine where in this 3rd block 10 belongs to (remember the cell is further divided into 2 units) so the correct equation is ((int)(10/3)*2)/2 = 3 so we know that 10 belongs to the 3rd block first section. If you have 11, ((int)(11/3)*2)/2 = 3.5 so we know that this number belongs to the second block of the block 3. Could someone please explain why does ((int)(11/3)*2)/2 this equation works?