01.06.2012, 10:36
Quote:
the modulo operator returns the remainder of 2 integers. for floats, you simply need to reinvent the formula:
Код:
new Float:a=10.0; new Float:b=4.0; new result=floatround((a/b),floatround_floor)*b; round_floor of 2.5 = 0.5 0.5 * 4.0 = 2.0 ...looks similar to 10 % 4 = 2 another test: 100.0 % 3.0 100.0/3.0=33.333333 0.333333*3.0=1.000000 100%33=1 ![]() |
![Wink](images/smilies/wink.png)