2017-05-08 64 views

回答

2

我會使用modulo%運算符。

remainder = x%n 
nearest_lower_integer_from_x = x - remainder 
+0

更長,但實際上與inspectorG4dget的答案相同。 – EquipDev

+1

Only * archetypally *。更合適的術語實際上是*更具教學意義*。 – Kanak