The number of multiples of less than or equal to is equal to ( is the floor value function). We want to subtract the multiples of that are strictly less than , which is just .
Therefore the number of multiples of between and , inclusive, is .
Hi All
Given the following numbers
a=2, b=19, c= 3
using the equation:
b/c - (a-1) / c
yields the result of how many numbers between a and b are divisible by c - I have tested this and it seems to work - but I am stumped if I know why?!
b/c gives the amount of times C divides into B using 0 as a base starting point, but what stumps me is the significance of (a-1)/c?
Can anyone give me the break down of it because for reason I just can't get it right in my head!!
Many thanks
The number of multiples of less than or equal to is equal to ( is the floor value function). We want to subtract the multiples of that are strictly less than , which is just .
Therefore the number of multiples of between and , inclusive, is .