OSDN Git Service

[fixed] rounding issues in MathUtils.ceil(). Thanks BurningHand!
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 21 Dec 2010 13:24:19 +0000 (13:24 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Tue, 21 Dec 2010 13:24:19 +0000 (13:24 +0000)
gdx/src/com/badlogic/gdx/utils/MathUtils.java

index 652e46d..df28be2 100644 (file)
@@ -161,7 +161,7 @@ public class MathUtils {
 \r
        static private final int BIG_ENOUGH_INT = 16 * 1024;\r
        static private final double BIG_ENOUGH_FLOOR = BIG_ENOUGH_INT;\r
-       static private final double BIG_ENOUGH_CEIL = BIG_ENOUGH_INT + 0.5;\r
+       static private final double BIG_ENOUGH_CEIL = BIG_ENOUGH_INT + 0.99999999;\r
 \r
        static public int floor (float x) {\r
                return (int)(x + BIG_ENOUGH_FLOOR) - BIG_ENOUGH_INT;\r