浏览代码

php: fixed Math.exp for NaN

Franco Ponticelli 12 年之前
父节点
当前提交
4c9498cd3c
共有 1 个文件被更改,包括 2 次插入0 次删除
  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 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 tan(v : Float) : Float      { return untyped __call__("tan", v); }
 	public static function exp(v : Float) : Float      {
 	public static function exp(v : Float) : Float      {
+		if(isNaN(v))
+			return NaN;
 		if(untyped __call__("is_finite", v))
 		if(untyped __call__("is_finite", v))
 			return untyped __call__("exp", v);
 			return untyped __call__("exp", v);
 		else if(v == POSITIVE_INFINITY)
 		else if(v == POSITIVE_INFINITY)