Chaos 0 Posted August 27, 2009 Hello, i have a little problem. I need round number, but my hint says "0" for the variable "_n". _posMax = 8; _cnt = 14; _n = _posMax/_cnt; ;~1.5 _n = floor (_n/1); hint format ["_n - %1",_n]; Where is the problem? Share this post Link to post Share on other sites
wamingo 1 Posted August 27, 2009 (edited) Floor will always round down. Ceil will always round up. Round will round to nearest. Maybe good to know is what programmers in other languages will often do is Floor ( n + 0.5 ) This will round to nearest but using a round down command. Just noticed that you joined the forum 1 day after me :) Edited August 27, 2009 by wamingo Share this post Link to post Share on other sites
EMSI 960 Posted August 27, 2009 _posMax = 8; _cnt = 14; _n = 8/14; _n = floor (0.57142..../1); _n = 0 Your calculation is correct. It will be always 0 (zero). Use ceil or round Share this post Link to post Share on other sites