This is the old busted veekun, which will be going away in the future. You may be looking for the new hotness.
(no blurb)
2 posts; 233 views
On the Stat Mechanics Page (http://veekun.com/dex/mechanics/stats), in the Nerd Stuff: Formulas section, you state that all calculations are done in integer precision and with normal order of operations. This makes the formulae perfectly correct, but since I'm a human and not a computer, my first instinct is to group that little level/100 calculation and do it first. In floating point, that wouldn't make a difference, but in integer precision it makes a huge difference since level/100 would be 0 unless level were 100.
Obviously, I was doing the calculations in wrong order; level is multiplied by the parenthetical result first. However, I suspect I'm not the first and won't be the last to be initially confused by thinking the division could be done first. A little blurb about the fact that level is multiplied first would make this point more obvious. A more subtle solution would be to place parentheses around the multiplication, although that would make the formulae bulkier.
Hm... After thinking a moment, the fact that I assume the multiplication is done first is based on a left to right reading. Any computer language that didn't read the code that direction (although I personally am not aware of any such languages) might actually get a different result. That makes the addition of parentheses a bit more appealing to me personally, but the decision is yours, of course.
Obviously, I was doing the calculations in wrong order; level is multiplied by the parenthetical result first. However, I suspect I'm not the first and won't be the last to be initially confused by thinking the division could be done first. A little blurb about the fact that level is multiplied first would make this point more obvious. A more subtle solution would be to place parentheses around the multiplication, although that would make the formulae bulkier.
Hm... After thinking a moment, the fact that I assume the multiplication is done first is based on a left to right reading. Any computer language that didn't read the code that direction (although I personally am not aware of any such languages) might actually get a different result. That makes the addition of parentheses a bit more appealing to me personally, but the decision is yours, of course.
posted at 05/12/09 16:00
-- 7 hours, 27 minutes since previous post
I've seen ancient languages that don't follow order of operations, but I've never seen one that doesn't compute infix left to right. That's rather the definition of infix.
Integer division isn't commutative. I should probably make a note to this effect somewhere.
Integer division isn't commutative. I should probably make a note to this effect somewhere.
44 weeks, 3 days
since last post
since last post
![[logo]](/images/veehead.png)
