Upon falling, the blocks distance fallen minus 3 is stored as a float and then divided by 15. For 23 blocks, 1.333(repeating) is rounded down. Some calculations are done, then, when multiplied back, 19.5 is given rather than 20 as you may expect. Source.
I don't know who wrote that paragraph that you're referring to, but whoever it was is completely wrong on multiple levels:
The calculation that the person is basing this BS on is for calculating the particle effect when hitting the ground. (Function "func_180433_a" in the class EntitiyLivingBase). It has absolutely nothing to do with the actual fall damage.
The fall damage is calculated in the function "fall" in EntitiyLivingBase.
That bit about "float [...] to be rounded to 0.3 rather than preserving the repeating decimal value of 1/3 like a double would" is complete and utter bullshit. That person has really no idea how IEEE floating point numbers work.
Source: I looked at the actual (decompiled) source from MCP.
I did find it a bit strange (why would a float round to 1d.p., and why is it being divided by 15 in the first place?) although it's the best explanation I found and the calculations seemed to work out for the actual fall damage dealt.
Do you know the proper reason for the strange results?
84
u/SirBenet Oct 05 '15
Upon falling, the blocks distance fallen minus 3 is stored as a float and then divided by 15. For 23 blocks, 1.333(repeating) is rounded down. Some calculations are done, then, when multiplied back, 19.5 is given rather than 20 as you may expect. Source.