How to simulate C style integer division?

Ben Finney ben+python at benfinney.id.au
Thu Jan 21 04:11:17 EST 2016


Shiyao Ma <i at introo.me> writes:

> I wanna simulate C style integer division in Python3.

I'm not sure I know exactly what behaviour you want (“C style” may mean
different things to each of us).

I'll point out that Python's ‘//’ operator specifies floor division
<URL:https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations>.

-- 
 \       “Timid men prefer the calm of despotism to the boisterous sea |
  `\                                    of liberty.” —Thomas Jefferson |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list