I need to port quite a few formulas from C to Python and vice versa. What is the best way to make sure that nothing breaks in the process?
I hope my question doesn\'
In C:
-11/2 = -5
In Python:
-11/2 = -5.5
and also in python:
-11//2 = -6
To achieve C-like behaviour, write int(-11/2) in python, this will evaluate to -5.
int(-11/2)
-5