Parcourir la source

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

Simon Krajewski il y a 9 ans
Parent
commit
6ff2e31a96
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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
 	// 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 inline function isFinite( f : Float ) : Bool {