Trailing zero

Source: Wikipedia, the free encyclopedia.

A trailing zero is any 0 digit that comes after the last nonzero digit in a number string in

decimal point and the last nonzero digit are necessary for conveying the magnitude of a number and cannot be omitted (ex. 100), while leading zeros – zeros occurring before the decimal point and before the first nonzero digit – can be omitted without changing the meaning (ex. 001). Any zeros appearing to the right of the last non-zero digit after the decimal point do not affect its value (ex. 0.100). Thus, decimal notation often does not use trailing zeros that come after the decimal point. However, trailing zeros that come after the decimal point may be used to indicate the number of significant figures
, for example in a measurement, and in that context, "simplifying" a number by removing trailing zeros would be incorrect.

The number of trailing zeros in a non-zero base-b

instruction set
for efficiently determining the number of trailing zero bits in a machine word.

In pharmacy, trailing zeros are omitted from dose values to prevent misreading.

Factorial

The number of trailing zeros in the

de Polignac's formula:[1]

where k must be chosen such that

more precisely

and denotes the

floor function
applied to a. For n = 0, 1, 2, ... this is

0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 6, ... (sequence A027868 in the OEIS).

For example, 53 > 32, and therefore 32! = 263130836933693530167218012160000000 ends in

zeros. If n < 5, the inequality is satisfied by k = 0; in that case the sum is empty, giving the answer 0.

The formula actually counts the number of factors 5 in n!, but since there are at least as many factors 2, this is equivalent to the number of factors 10, each of which gives one more trailing zero.

Defining

the following recurrence relation holds:

This can be used to simplify the computation of the terms of the summation, which can be stopped as soon as q i reaches zero. The condition 5k+1 > n is equivalent to q k+1 = 0.

See also

  • Trailing digit

References