You can do shorter in languages with functional constructs. For example Python:
sum(map(lambda x: x // 3 - 2, numbers)) sum(map(lambda x: x // 3 - 2, numbers))Thus for Python 3 the new // operator was added for explicit floor division (which is often quite useful in its own right), leaving the / operator to always return an exact (to machine precision) floating point result, even with integer arguments.
cf. https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...
numbers.sumBy { it / 3 - 2 }