What am I missing?
float stepSize = 0.0f;
int activeCircleRadius = 10;
int numSteps = 24;
AiLog.v("init activeCircleRadius " + activeCircleRadius + " numSteps "
+ numSteps);
stepSize = activeCircleRadius / numSteps;
AiLog.v("stepSize is " + stepSize);
stepSize is always zero in the log after the operation. Does it have to do with dividing a float by an int?
Here both variables are integers so you are performing integer division:
The result of integer division is an integer. The result is truncated.
To fix the problem, change the type of one (or both) variables to a
float:Or add a cast to float in the division expression: