소스 검색

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

Nicolas Cannasse 12 년 전
부모
커밋
93b3c0788d
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      std/flash8/_std/Std.hx

+ 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 {