0. If an array is used to represent a cycle, it is convenient to obtain the index with a modulo function, which can result in zero. Numerical properties With zero-based numbering, a range can be expressed as the half-open interval, , as opposed to the closed interval, . Empty ranges, which often occur in algorithms, are tricky to express with a closed interval without resorting to obtuse conventions like . Because of this property, zero-based indexing potentially reduces off-by-one and fencepost errors. On the other hand, the repeat count n is calculated in advance, making the use of counting from 0 to (inclusive) less intuitive. Some authors prefer one-based indexing, as it corresponds more closely to how entities are indexed in other contexts. Another property of this convention is in the use of modular arithmetic as implemented in modern computers. Usually, the modulo function maps any integer modulo N to one of the numbers , where . Because of this, many formulas in algorithms (such as that for calculating hash table indices) can be elegantly expressed in code using the modulo operation when array indices start at zero. Pointer operations can also be expressed more elegantly on a zero-based index due to the underlying address/offset logic mentioned above. To illustrate, suppose a is the memory address of the first element of an array, and i is the index of the desired element. To compute the address of the desired element, if the index numbers count from 1, the desired address is computed by this expression: a + s × (i − 1), where s is the size of each element. In contrast, if the index numbers count from 0, the expression becomes a + s × i. This simpler expression is more efficient to compute at run time. However, a language wishing to index arrays from 1 could adopt the convention that every array address is represented by ; that is, rather than using the address of the first array element, such a language would use the address of a fictitious element located immediately before the first actual element. The indexing expression for a 1-based index would then be a′ + s × i. Hence, the efficiency benefit at run time of zero-based indexing is not inherent, but is an artifact of the decision to represent an array with the address of its first element rather than the address of