The slash symbol can be used as the division operator to produce the result of a quotient division calculation of two [[operand?]]s:
answer = 18 / 3 # 6
The division [[combination_assignment_operator?]] represented by a [[climbequal?]]s digraph, can also be used to perform a quotient division calculation:
value /= 3 # value = value / 3
The awk programming language does not support the use of a backslash symbol as an integer division operator. However, the [[int?]] function can be used to produce [[integer?]] results from a mathematical quotient:
BEGIN { print int(22 / 6) }
Traditional Unix behaviour is to abort awk with a fatal error, if a division by zero is encountered.
The mawk interpreter does not abort with a fatal error if a division by zero is encountered. Instead mawk returns an inf string without producing a warning or error: