According to the documentation on primitives, 1.7976931348623158e+308 is the maximum value of a double. However, formatInt(1.7976931348623158e+308, "e") will print "inf". (Doing some brute-force testing, if the latest digit there is anything higher than 5, "inf" will be the result.)
According to this C++ reference, the maximum double value is 1.79769e+308. Where did you get the value as documented? Could it be non-portable (e.g. works on Windows, but is technically higher than the max)?
Thank you.