Browse Source

revert change to Std.parseFloat (cause more unit tests to fail)

Nicolas Cannasse 13 years ago
parent
commit
b5bd857a30
1 changed files with 1 additions and 4 deletions
  1. 1 4
      std/php/_std/Std.hx

+ 1 - 4
std/php/_std/Std.hx

@@ -46,11 +46,8 @@
 			return x.substr(0, 2).toLowerCase() == "0x" ? __php__("(int) hexdec(substr($x, 2))") : __php__("intval($x)");
 			return x.substr(0, 2).toLowerCase() == "0x" ? __php__("(int) hexdec(substr($x, 2))") : __php__("intval($x)");
 	}
 	}
 
 
-	static var NAN : Float = untyped __call__("acos", 1.01);
 	public static function parseFloat( x : String ) : Float {
 	public static function parseFloat( x : String ) : Float {
-		var v : Float = untyped __call__("floatval", x),
-			s = "" + v;
-		return x.substr(0, s.length) == s ? v : NAN;
+		return untyped __php__("is_numeric($x) ? floatval($x) : acos(1.01)");
 	}
 	}
 
 
 	public static function random( x : Int ) : Int {
 	public static function random( x : Int ) : Int {