What is the meaning of the symbol '%' such as in this sentence:
assert (timesteps % pool_size == 0)
What is the meaning of the symbol '%' such as in this sentence:
assert (timesteps % pool_size == 0)
It is the modulo operation. Which returns the remainder from divison on 2 numbers.
3 % 1 = 0
3 % 2 = 1
3 % 3 = 0
So in your code if pool_size becomes equal to timesteps or is a factor of it, then the result would be 0
%
is the modulo operator. It gives you the remainder after dividing the left-hand side by the right-hand side. For instance, 12 % 10
will return 2
.
Here, it's being used to check if timesteps
is divisible by pool_size
.