Hi Vranasm,
You left me a message long time ago about how the game deals with numbers:
"not sure I fully grasp what you ask about those roundings. There is no uncertainty in C++ or better said data type conversion.
if you assign float into integer then always you take just what is before the decimal point (aka 2.3 = 2, 2.5 = 2, 2.9 = 2) if you want to do some roundings you typically add +0.5 since it doesn't change the integer (2.3+0.5 = 2.8 = 2, 2.5+0.5 =3 = 3, 2.8+0.5 = 3.3 = 3)
or some languages offer "round" functions."
I was waiting to find some substancial evidences to reply. Code-wise, it hasn't changed.
But looked at this article on unit upkeep, there is a mention of rounding down and up.
You left me a message long time ago about how the game deals with numbers:
"not sure I fully grasp what you ask about those roundings. There is no uncertainty in C++ or better said data type conversion.
if you assign float into integer then always you take just what is before the decimal point (aka 2.3 = 2, 2.5 = 2, 2.9 = 2) if you want to do some roundings you typically add +0.5 since it doesn't change the integer (2.3+0.5 = 2.8 = 2, 2.5+0.5 =3 = 3, 2.8+0.5 = 3.3 = 3)
or some languages offer "round" functions."
I was waiting to find some substancial evidences to reply. Code-wise, it hasn't changed.
But looked at this article on unit upkeep, there is a mention of rounding down and up.