maths.free › Numerical Methods › Floating point and error

Floating point and error

Why 0.1 + 0.2 ≠ 0.3 on a computer, and how error propagates.

Computers store numbers in binary with ~16 significant digits; 0.1 is not representable exactly. Round-off accumulates, and subtracting nearly equal numbers destroys digits (cancellation). Picture it: 255 in binary is 11111111, and 0.1 in binary never terminates. Think it: a stable algorithm keeps error growth linear; conditioning is a property of the problem, stability of the method.

Намунаи коркардашуда · 0.1 + 0.2

Evaluate 0.1 + 0.2

0.1 + 0.2

Қадами ба қадам

  1. 0.3 = \frac{3}{10}

    Add: 0.1 + 0.2 = 3/10.

  2. \frac{3}{10} = 0.3

    Simplify.

Ҷавоби ҷавобро нишон диҳед
0.3

Ҳоло шумо Масъаларо интихоб кунед, ё ки онро навишта ё кашед. Ҳар қадам, тасвир, ҷавоб то он даме, ки шумо пурсед, пинҳон мешавад.

Кор кардан

Дар ҳисоби ройгон ба ҳар як дарс қайдҳо илова карда мешаванд, қайди он, ки шумо чӣ кор кардаед, масъалаҳои ҳалшуда дар як ҷо ва муаллиме, ки шумо метавонед дар бораи ин саҳифа пурсед. Математика барои ҳама кушода аст, хоҳ ворид шуда бошад ё на.

Бақайдгирӣ Ворид шудан

Символы, используемые здесь

Барои муайянкунии пурраи маъно, тасвир ва маънои ҳар як ҳарф дар он, ба ҳар як аломат пахш кунед.

Чӣ тавр: Floating point and error

  1. Add: 0.1 + 0.2 = 3/10.
  2. Simplify.

Саволҳои маъмул

Why not just solve exactly?

Most equations have no closed-form solution at all, and many that do are unusable in practice. A numerical method delivers as many correct digits as you need, and a good one tells you how many that is.

Why can Newton's method fail?

If it starts where the tangent is nearly flat it shoots far away; near a repeated root it slows to a crawl; and with several roots it may land on the wrong one. A bracketing method like bisection is slower but cannot fail.

& Иловаи забон Numerical Methods