2
0
Эх сурвалжийг харах

fixed Std.int should overflow on 32 bits (cross platform behavior)

Nicolas Cannasse 12 жил өмнө
parent
commit
93b3c0788d

+ 2 - 3
std/flash8/_std/Std.hx

@@ -30,9 +30,8 @@
 		return untyped flash.Boot.__string_rec(s,"");
 	}
 
-	public static function int( x : Float ) : Int {
-		if( x < 0 ) return Math.ceil(x);
-		return Math.floor(x);
+	public static inline function int( x : Float ) : Int {
+		return (cast x) | 0;
 	}
 
 	public static function parseInt( x : String ) : Null<Int> untyped {