try to work around win64 overflow issue
* on win64, python int = c long = 32bit, and numpy silently overflows various int operations... try casting one operand to int64 explicitly