integer arithmetic

Maths on whole numbers only, which is all bash can do itself: 7 / 2 gives 3, with the remainder dropped.

In more detail

Use $(( )) or let for integer maths and % for the remainder. For fractions, hand the calculation to bc or awk.

Related terms

Taught in

References