Wild Stat Result + Stat Point Result = Max Stat
However, someone here (spunman, I believe) took the Stat Point formula and figured out where the integral functions should apply. For reference, here are the formula's
Wild Stat = (int( Level * ( BaseStat + DV ) / 50 ) + 5)
This works out fine.
Stat Points = int(Level * int(( 16 + int(Sqrt(256 * Stat Exp - 512))) / 128) / 50 )
This, on the other hand, will give 62 with 65025 Stat Experience, which should yield 63.9999. I have found that this is due to the integral funtions.
For example, a max stat Mew (for simplicity sake, I will use his stats) at Level 100 has a 298 in everything besides HP. Here is how the two formula's above work it out, though:
(int(100 * (100 + 15) / 50) + 5) + int(100 * int((16 + int(sqrt(256 * 65025 - 512))) / 128) / 50)
(int(100 * 115 / 50) + 5) + int(100 * int((16 + int(Sqrt(1625625 - 512))) / 128) / 50)
(int(11500 / 50) + 5) + int(100 * int((16 + int(Sqrt(1625113))) / 128) / 50)
(230 + 5) + int(100 * int((16 + 4079) / 128) / 50)
235 + int(100 * int(4095 / 128) / 50)
235 + int(100 * 31 / 50)
235 + int(3100 / 50)
235 + 62
297, which is one point short of max.
If you take the integral functions out of the formula's above, and only apply one integral function on the final result, you obtain 298. Apparently, the game actually uses the decimal results in the Stat Calculations in order to give you the most boost.
So, in conclusion, the game actually doesn't have many integral functions when it comes to stat calculation. I believe, through testing, that only 2 int's exist in the above formula: the one in the Wild Stat formula and the outermost int in the Stat Point formula.
That's about it. Any other ideas as to why this is, I would love to here them.
Oh, I see! Oh wait, no, I don't.
P = int((sqrt(S - 1) + 1) / 4)
which is derived from reversing the Stat Points --> SE Value function
int(S) = 16 * P^2 - 8 * P + 2
I'm not sure where you got your
int(Level * int((16 + int(Sqrt(256 * Stat Exp - 512))) / 128) / 50) as the formula, but you said that it gave 62 at max SE. Try my formula and see what you can do.
Just thought these 2 formula's could help in the making of Stat Calculators and Pokemon Battling Systems, as it takes the full amount of stat exp. into account, and not just either max stat or wild.