python division truncate to zero code example
Example 1: python divide floor
In Python 3.0
5 // 2 floor division will return 2.
5 / 2 floating point division will return 2.5
Example 2: truncate toward zero python
>>> int(float(-1)/2)
0
>>> int(float(-3)/2)
-1
>>> int(float(1)/2)
0
>>> int(float(3)/2)
1