فهرست منبع

php: minor improvments on previous patch by Greg Dove

Franco Ponticelli 12 سال پیش
والد
کامیت
bdc1c3c821
2فایلهای تغییر یافته به همراه2 افزوده شده و 14 حذف شده
  1. 0 12
      std/php/Boot.hx
  2. 2 2
      std/php/_std/Math.hx

+ 0 - 12
std/php/Boot.hx

@@ -487,18 +487,6 @@ class _hx_list_iterator implements Iterator {
 	}
 }
 
-function _hx_max($a, $b) {
-	if(is_nan($a) || is_nan($b))
-		return Math::$NaN;
-	return max($a, $b);
-}
-
-function _hx_min($a, $b) {
-	if(is_nan($a) || is_nan($b))
-		return Math::$NaN;
-	return min($a, $b);
-}
-
 function _hx_null() { return null; }
 
 class _hx_nullob {

+ 2 - 2
std/php/_std/Math.hx

@@ -27,8 +27,8 @@
 	public static var NEGATIVE_INFINITY(default,null) : Float;
 
 	public static function abs(v : Float) : Float      { return untyped __call__("abs", v); }
-	public static function min(a : Float,b : Float) : Float    { return untyped __call__("_hx_min", a, b); }
-	public static function max(a : Float,b : Float) : Float    { return untyped __call__("_hx_max", a, b); }
+	public static function min(a : Float,b : Float) : Float    { return untyped !isNaN(a) ? __call__("min", a, b) : NaN; }
+	public static function max(a : Float,b : Float) : Float    { return untyped !isNaN(b) ? __call__("max", a, b) : NaN; }
 	public static function sin(v : Float) : Float      { return untyped __call__("sin", v); }
 	public static function cos(v : Float) : Float      { return untyped __call__("cos", v); }
 	public static function atan2(y : Float,x : Float) : Float  { return untyped __call__("atan2", y, x); }