arithmetic

The awk programming language provides a set of [[dyadic?]] arithmetic operators for performing basic arithmetic on [[integer?]] and [[floating_point?]] values.

*Operator**Description*
+[[addition?]]
-[[subtraction?]]
!*multiplication
!/division
%modulus
 print 6 + 3     # addition
 print 8 - 3     # subtraction
 print 6 * 3     # multiplication
 print 10 / 4    # division
 print 10 % 4    # modulus

The awk programming language does not provide an exponent operator

Traditionally, the awk programming language does not provide an exponent operator.

The backslash symbol may not be used for integer division

Traditionally, the awk programming language does not support the use of a backslash symbol as an [[integer_division?]] operator.


[[Calculations_involving_integers_may_produce_floating_point_results?]]

precedence