Except for remainder (%) all other arithmetic operators can accept a mix of integer and real operands. Generally, if both operands are integers then the result
will be an integer. However, if one or both of the operands are reals then the result will be a real (or double to be exact).

When both operands of the division operator (/) are integers then the division is performed as an integer division and not the normal division we are used to.
Integer division always results in an integer outcome (i.e., the result is always rounded down).

For example:

9 / 2 // gives 4, not 4.5!
-9 / 2 // gives -5, not -4!

Follow

Get every new post delivered to your Inbox.