Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
25で割った最も近い値に切り上げるか切り下げる必要のある整数がたくさんあります。
例えば:
417は425に切り上げます
405は400に切り捨てられます
最も近い値に丸めるために、何かの前の値に25/2を追加します
function roundTo(value、rounding){temp = value + rounding / 2; return temp-temp%rounding; }
int roundedValue = (valueToRound + 12) / 25 * 25;