Closed Gama11 closed 4 years ago
I am not sure how to reliably parse string into a "Haxe UInt"
public function parseUInt(v:String) {
var ret:UInt = 0;
for(i in 0...v.length) ret += Std.parseInt(v.charAt(i)) * Std.int(Math.pow(10, v.length - i - 1));
return ret;
}
var u = parseUInt('2147483648'); // gives a native int of value 2147483648 on python
trace(u == 0x80000000); // false, because the latter is generated as -2147483648
Not sure what to expect here...
Keeping open for the python mystery
UInt
is currently not serialized correctly on all targets / has inconsistent results across targets.{"i":2147483648}
{"i":-2147483648}
Not sure if there's more targets with incorrect results.