Browse Source

[lua] put parens around the 0/0 NaN to avoid eval order issues

Simon Krajewski 8 years ago
parent
commit
6ff2e31a96
1 changed files with 1 additions and 1 deletions
  1. 1 1
      std/lua/_std/Math.hx

+ 1 - 1
std/lua/_std/Math.hx

@@ -36,7 +36,7 @@ class Math
 
 
 	// Note: this has to be an untyped literal, otherwise the compiler tries
 	// Note: this has to be an untyped literal, otherwise the compiler tries
 	// to unify it to an Int, which defeats useful numeric reflection behavior.
 	// to unify it to an Int, which defeats useful numeric reflection behavior.
-	static inline function get_NaN () : Float return untyped __lua__("0/0");
+	static inline function get_NaN () : Float return untyped __lua__("(0/0)");
 
 
 	public static function isNaN( f : Float ) : Bool return (f != f);
 	public static function isNaN( f : Float ) : Bool return (f != f);
 	public static inline function isFinite( f : Float ) : Bool {
 	public static inline function isFinite( f : Float ) : Bool {