ScanSkill

/ (division)

This / (division) arithmetic operator returns the quotient of the two expressions.

Syntax

A / B

Here, A and B are called operands and '/' is a division operator.

  • A: An expression that is evaluating to a numeric type.
  • B: An expression that is evaluating to a numeric type.

Note: For (plain or long) integer division, the result is always an integer. And the result is always rounded towards minus infinity: 1/2 is 0, (-1)/2 is -1, 1/(-2) is -1, and (-1)/(-2) is 0.

Also, the result is a long integer if either operand is a long integer, regardless of the numeric value.

Examples

>>> 2 / 1
2
>>> 2 / 1.0
2.0
>>> 2.0 / 1
2.0
>>> 2 / 0.7
2.857142857142857