Hi der Raab,
I actually had a similar need when I was working on a math-y project (Project Euler) - I'm used to an Int.MAX value as well. I just brute-forced the values. It's probably not as eloquent as using someone else's library but part of the goal was to do it myself anyway.
On the first run of my app on a system, it iterates through an integer value and stores the maximum in a text file for future use - this way, I don't need to run through those loops again. (If that text file does not exist, the app hasn't been run yet).
I've done this for other data types, too, but here is the MWE for it:
class Main extends MovieClip
{
public static function main():Void
{
Max.init();
trace(Max.INT); // 2147483647
}
}
class Max
{
public static var INT:Int;
/* ... */
public static function init():Void
{
var intOverflow:Int = 0;
while (++intOverflow > 0)
INT = intOverflow;
}
}
-Will