[M3devel] integer division/mod questions?

hendrik at topoi.pooq.com hendrik at topoi.pooq.com
Wed Jan 20 17:23:15 CET 2010


On Wed, Jan 20, 2010 at 02:59:43AM +0000, Jay K wrote:
>  
> Integer division probably not a big concern anyway, esp. with any 
> negative numbers. The main place I ever see division/mod used is hash 
> tables, and the numbers are always positive

And that's where it's important that the remainder has the same sign as 
the divisor.

> (I rarely see negative numbers used anywhere in "systems" programming 
> actually -- file sizes, array indices, array sizes..all positive; 
> "math" needs floating point often...)

You can get negative numbers in the subscripting calculations for an 
array whose subscripts are in the range like 10000..10345.

-- hendrik



More information about the M3devel mailing list