Question: I have two integer values `a` and `b`, but I need their ratio in floating point. I know that `a < b` and I want to calculate `a / b`, so if I use integer division I'll always get 0 with a remainder of `a`.

How can I force `c` to be a floating point number in Python 2 in the following?

```
c = a / b

```

---

In 3.x, the behaviour is reversed; see [Why does integer division yield a float instead of another integer?](https://stackoverflow.com/questions/1282945) for the opposite, 3.x-specific problem.

Answer: 
Just making any of the parameters for division in floating-point format also produces the output in floating-point.

Example:

```
>>> 4.0/3
1.3333333333333333

```

or,

```
>>> 4 / 3.0
1.3333333333333333

```

or, 

```
>>> 4 / float(3)
1.3333333333333333

```

or, 

```
>>> float(4) / 3
1.3333333333333333

```
```
from operator import truediv

c = truediv(a, b)

```