Selaa lähdekoodia

php: fixed Math.exp for NaN

Franco Ponticelli 12 vuotta sitten
vanhempi
commit
4c9498cd3c
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      std/php/_std/Math.hx

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

@@ -34,6 +34,8 @@
 	public static function atan2(y : Float,x : Float) : Float  { return untyped __call__("atan2", y, x); }
 	public static function tan(v : Float) : Float      { return untyped __call__("tan", v); }
 	public static function exp(v : Float) : Float      {
+		if(isNaN(v))
+			return NaN;
 		if(untyped __call__("is_finite", v))
 			return untyped __call__("exp", v);
 		else if(v == POSITIVE_INFINITY)