I have a VariableA (initialized with zero) , VariableB (initialized to constant integer X)
Variable A is increasing unevenly eg: +1, +3, +7, + 24.......
I would like to check if a variableA has reached a predefined threshold value of VariableB , I tried using Mod operator but since the variableA is increasing in a uneven format, I am not able to exactly check @ what point VariableA has crossed VariableB threshold.
Eg: Case 1
VariableA - 12 VariableB - 20 - Output - A has not touched the threshold yet
Case 2
VariableA - 19 VariableB - 20 - Output - A has not touched the threshold yet
Case 3 VariableA - 25 VariableB - 20 - Output - A has touched the current threshold
Case 4 VariableA - 41 VariableB - 20 - Output - A has touched the threshold
Case 5 VariableA - 48 VariableB - 20 - Output - A has not touched the next threshold, Since 20+20+20 has not happened.
Edits:
Case 5 VariableA - 48 VariableB - 20 - 1st Threshold will reach when VariableA is greater than or equal to Variable B (20), 2nd Threashold Will reach when variableA is greater than or equal to 2XVariableB(40), 3rd Threshold will reach when VariableA is greater than or equal to 3XVariableB(60)
Please suggest ...