After overflowing array capacity `rear` becomes smaller than `front` and the formula will return negative value.