Batting average is calculated by dividing the number of hits by at bats or the number of balls faced.