Bug 913228 - Fix floating point math to not round to zero accidentally. r=autra

This commit is contained in:
Kartikaya Gupta 2013-09-06 12:43:06 -04:00
parent d625c81d47
commit df795739bf

View File

@ -92,7 +92,7 @@ abstract class Axis {
// The values we use for friction are based on a 16.6ms frame, adjust them to currentNsPerFrame:
static float getFrameAdjustedFriction(float baseFriction, long currentNsPerFrame) {
float framerateMultiplier = currentNsPerFrame / NS_PER_FRAME;
float framerateMultiplier = (float)currentNsPerFrame / NS_PER_FRAME;
return (float)Math.pow(Math.E, (Math.log(baseFriction) / framerateMultiplier));
}