Android Studio 0.5.2
Hello,
I have a random float value that I want to convert to an int.
The float could have a random number between -9.4182062E-9 to 9.593071E-8.
I just want to get the positive int number so if the number is negative i.e. -5.5115866E-8 it should just return 5. I have used the Math.abs for this.
I have tried the following:
int accel = (int)Math.abs(randomAccel);
However, accel keeps giving me a zero no matter what value randomAccel is.
Many thanks for any suggestions,