Top "Integer-arithmetic" questions

Anything related to integer arithmetic, i.e. arithmetic operations on integer numbers.

How to perform ceiling-division in integer arithmetic?

It's basically returning the boxes_needed. 1 box can contain 10 items. So if the items typed by the user is 102 then …

python rounding integer-arithmetic
Times-two faster than bit-shift, for Python 3.x integers?

I was looking at the source of sorted_containers and was surprised to see this line: self._load, self._twice, …

python python-3.x performance bit-shift integer-arithmetic
Printing short int using various format specifiers

Please have a look at this code: #include <stdio.h> int main(void) { short s = -1; printf("sizeof(…

c casting integer-arithmetic
Floored integer division

Is there an easy, efficient and correct (i.e. not involving conversions to/from double) way to do floored integer …

c# .net math integer-arithmetic
Why int plus uint returns uint?

int plus unsigned int returns an unsigned int. Should it be so? Consider this code: #include <boost/static_assert.…

c++ int unsigned integer-arithmetic