RuneTrack Forums http://runetrack.com/forums/ |
|
Skill progress graph's maximum http://runetrack.com/forums/viewtopic.php?f=4&t=163 |
Page 1 of 1 |
Author: | jim360 [ Mon Nov 08, 2010 2:40 pm ] |
Post subject: | Skill progress graph's maximum |
Hi, Unfortunately, Skiller, Zarfot (97914252727i) and Jdelacroix have all passed 2,147,483,647 experience total: http://runetrack.com/progress.php?user=skiller http://runetrack.com/progress.php?user=9791425727i http://runetrack.com/progress.php?user=Jdelacroix Which is the highest number in JavaScript, I believe? So their progress graphs stop once they're passed this number. Any way to get round this? On a related note, for some reason on this page: http://runetrack.com/progress.php?user=Telmomarques The data point for October 16th is in between July 28th and July 29th, leading to an odd spike in the graph. |
Author: | Sword Kill11 [ Mon Nov 22, 2010 7:11 am ] |
Post subject: | Re: Skill progress graph's maximum |
Hi Jim360, Thanks for letting me know about this. The fix was actually much easier than I imagined. 2,147,483,647 is not the maximum value of any programming language per se, but you see it come up a lot as it's the maximum value an integer can typically hold. Integers are usually 4 bytes, the same as 32 bits (8 bits to a byte), meaning they can go up to 2^32 in value unsigned (or ((2^32)/2)-1 signed, as half of them go to the negative end and zero counts towards the positive end). (2^32)/2)-1 = 2,147,483,647, so that's where that limit comes from. Anyway, as I had the data point values cast as integers, I just set them as un-casted PHP values instead, which have a much higher range. Also fixed the issue with Telmomarques' graph - not exactly sure why that point was appearing out of place, but it's all fixed now. ![]() |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |