encyclopegia.org

Guard digit

In numerical analysis, one or more guard digits can be used to reduce the amount of roundoff error.[src]

In numerical analysis, one or more guard digits can be used to reduce the amount of roundoff error.[src] ==Example== Suppose that the final result of a long, multi-step calculation can be safely rounded off to N decimal places.[src] That is to say, the roundoff error introduced by this final roundoff makes a negligible contribution to the overall uncertainty.[src] However, it is quite likely that it is not safe to round off the intermediate steps in the calculation to the same number of digits.[src] Be aware that roundoff errors can accumulate.[src] If M decimal places are used in the intermediate calculation, we say there are M−N guard digits.[src] ==In computing== Guard digits are also used in floating point operations in most computer systems.[src] As an example, consider the subtraction 2^1 \times 0.100_2 - 2^0 \times 0.111_2 .[src] Here, the product notation indicates a binary floating point representation with the exponent of the representation given as a power of two and with the significand given with three bits after the binary point.[src] To compute the subtraction it is necessary to change the forms of these numbers so that they have the same exponent, and so that when the product notation is expanded the resulting numbers have their binary points lined up with each other.[src] Shifting the second operand into position, as 2^1 \times 0.0111_2 , gives it a fourth digit after the binary point.[src] This creates the need to add an extra digit to the first operand—a guard digit—putting the subtraction into the form 2^1 \times 0.1000_2 - 2^1 \times 0.0111_2 .[src] Performing this operation gives as the result 2^1 \times 0.0001_2 or 2^{-2} \times 0.100_2 .[src] Without using a guard digit the subtraction would be performed only to three bits of precision, as 2^1 \times 0.100_2 - 2^1 \times 0.011_2 , yielding 2^1 \times 0.001_2= or 2^{-1} \times 0.100_2 , twice as large as the correct result.[src] Thus, in this example, the use of a guard digit led to a more accurate result.[src] An example of the error caused by floating point roundoff is illustrated in the following C code.[src] int main(){ double a; int i; a = 0.2; a += 0.1; a -= 0.3; for (i = 0; a It appears that the program should not terminate.[src] Yet the output is: i=54, a=1.000000 Another example is: Take two numbers: 2.56\times 10^0 and 2.34\times 10^2 We bring the first number to the same power of 10 as the second one: 0.0256\times 10^2 The addition of the two numbers is: 0.0256*10^2 2.3400*10^2 + ____________ 2.3656*10^2 After padding the second number (i.e., 2.34\times 10^2 ) with two 0 s, the bit after 4 is the guard digit, and the bit after is the round digit.[src] The result after rounding is 2.37 as opposed to 2.36 , without the extra bits (guard and round bits), i.e., by considering only 0.02+2.34 = 2.36 .[src] The error therefore is 0.01 .[src]

21 sentences · 21 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Guard digit." encyclopegia.org, 2024, https://encyclopegia.org/wiki/guard-digit. Accessed 29 November 2026.

Chicago

"Guard digit." encyclopegia.org. Accessed November 29, 2026. https://encyclopegia.org/wiki/guard-digit.

APA

encyclopegia.org. (2024). Guard digit. Retrieved November 29, 2026, from https://encyclopegia.org/wiki/guard-digit

Accessed November 29, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1232525628 · 0.5 · snapshot enwiki-001232525628

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.