Trailing zero

Trailing zero

In mathematics, trailing zeros are a sequence of 0s in the decimal representation (or more generally, in any positional representation) of a number, after which no other digits follow.

Trailing zeros to the right of a decimal point, as in 12.3400, do not affect the value of a number and may be omitted if all that is of interest is its numerical value. This is true even if the zeros recur infinitely. However, trailing zeros may be useful for indicating the number of significant figures, for example in a measurement. In such a context, "simplifying" a number by removing trailing zeros is incorrect.

The number of trailing zeros in a base-"b" integer "n" equals the exponent of the highest power of "b" that divides "n". For example, 14000 has three trailing zeros and is therefore divisible by 1000 = 103. This property is useful when looking for small factors in integer factorization. Binary numbers with many trailing zero bits are handled similarly in computer arithmetic.

Factorial

The number of trailing zeros in the decimal representation of "n"!, the factorial of a non-negative integer "n", can be determined with this formula: [Summarized from [http://www.purplemath.com/modules/factzero.htm Factorials and Trailing Zeroes] ]

:f(n) = sum_{i=1}^k left lfloor frac{n}{5^i} ight floor =left lfloor frac{n}{5} ight floor + left lfloor frac{n}{5^2} ight floor + left lfloor frac{n}{5^3} ight floor + cdots + left lfloor frac{n}{5^k} ight floor, ,

where "k" must be chosen such that

:5^{k+1} > n,,

and ⌊"a"⌋ denotes the floor function applied to "a".

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

:left lfloor frac{32}{5} ight floor + left lfloor frac{32}{5^2} ight floor = 6 + 1 = 7,

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 equal to the number of factors 10, each of which gives one more trailing zero.

Defining

:q_i = left lfloor frac{n}{5^i} ight floor,,

the following recurrence relation holds:

:egin{align}q_0,,,,, & = ,,,n,quad \ q_{i+1} & = left lfloor frac{q_i}{5} ight floor.,end{align}

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 nowrap|5"k"+1 > "n" is equivalent to nowrap|1= "q" "k"+1 = 0.

References

External links

* [http://www2.hursley.ibm.com/decimal/decifaq1.html#tzeros "Why are trailing fractional zeros important?"] for some examples of when trailing zeros are significant
* [http://www.medscape.com/viewarticle/503274 Mu and Trailing Zero] &ndash; a case where trailing zeros are deprecated.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Zero crossing — is a commonly used term in electronics, mathematics, and image processing. In mathematical terms, zero crossing basically means the changing of sign (e.g. from positive to negative), that is represented with a crossing of the axis (zero value) in …   Wikipedia

  • Trailing wheel — On a steam locomotive, a trailing wheel or trailing axle is an unpowered wheel or axle located behind the driving wheels. The axle of the trailing wheels were usually located on a trailing truck.Trailing wheels were used in some early locomotives …   Wikipedia

  • zero-lift chord — A chord taken through the trailing edge of an airfoil in the direction of the relative wind when the airfoil is at a zero lift angle of attack. See zero lift angle …   Aviation dictionary

  • zero-lift line — A line through an airfoil, along which the relative airflow produces zero lift. This line is drawn through the trailing edge of an airfoil parallel to the relative airflow when the lift generated by the airfoil is zero …   Aviation dictionary

  • Non-return-to-zero — The binary signal is encoded using rectangular pulse amplitude modulation with polar non return to zero code In telecommunication, a non return to zero (NRZ) line code is a binary code in which 1 s are represented by one significant condition… …   Wikipedia

  • Soulz at Zero — poster Flack had hanging on his bedroom wall at the time, with the trailing s in Souls changed to a z .In the early to mid 1990s, several ANSI art groups began including lits (short pieces of fiction or poetry) in their packs. Expanding on that… …   Wikipedia

  • Pinochle — The jack of diamonds and the queen of spades are the pinochle meld of pinochle. Type Trick taking Players 4 in partnerships or 3 individually, variants exist for 2 6 or 8 players Skill(s) required …   Wikipedia

  • Binary GCD algorithm — The binary GCD algorithm is an algorithm which computes the greatest common divisor of two nonnegative integers. It gains a measure of efficiency over the ancient Euclidean algorithm by replacing divisions and multiplications with shifts, which… …   Wikipedia

  • Maritime Mobile Service Identity — A Maritime Mobile Service Identity (MMSI) is a series of nine digits which are sent in digital form over a radio frequency channel in order to uniquely identify ship stations, ship earth stations, coast stations, coast earth stations, and group… …   Wikipedia

  • Factorial — n n! 0 1 1 1 2 2 3 6 4 24 5 120 6 720 7 …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”