larsiusprime February 2016

Parsing a string representation of a uint64 to a haxe.Int64

I have a a string representation of a big integer, in this case "1083715881696", which I would like to place in a numeric variable.

If I do:

var int:Int = Std.parseInt("1083715881696");

It fails, and I get the result 2147483647 which is 0x7FFFFFFF in hex.

I'd like something like a Std.parseInt64 function, basically -- what's the logical equivalent? I assume the type I'm going to want to store it in here is haxe.Int64, as well.


Franco Ponticelli February 2016

Next version of Haxe will have such helper:

If you want to use it today you can use thx.core:

If your big-integers are really big you can also use:

Post Status

Asked in February 2016
Viewed 3,828 times
Voted 8
Answered 1 times


Leave an answer