Browse Source

add comment about (under|over)flow in float to Int64 conversion (#6628)

Giuseppe Di Mauro 8 years ago
parent
commit
b70f2621d8
1 changed files with 4 additions and 1 deletions
  1. 4 1
      std/haxe/Int64Helper.hx

+ 4 - 1
std/haxe/Int64Helper.hx

@@ -82,7 +82,10 @@ class Int64Helper {
 
 		var noFractions = f - (f % 1);
 
-		// 2^53-1 and -2^53: these are parseable without loss of precision
+		// 2^53-1 and -2^53+1: these are parseable without loss of precision.
+		// In theory 2^53 and -2^53 are parseable too, but then there's no way to
+		// distinguish 2^53 from 2^53+1 
+		// (i.e. trace(9007199254740992. + 1. > 9007199254740992.); // false!)
 		if (noFractions > 9007199254740991) {
 			throw "Conversion overflow";
 		}