dmitriyandreev (
dmitriyandreev) wrote2023-02-23 08:48 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Entry tags:
Про округление
Самый громкий провал вышел 25 февраля 1991 года, когда выпущенная иракцами ракета “Al Hussein” попала в казармы в Дахране (Саудовская Аравия) убив 28 американских солдат и ранив более сотни. Казармы находились под защитой комплекса «ПЭТРИОТ», который обнаружил ракету… но из-за накопившейся ошибки, связанной с дефектным алгоритмом округления данных, при попытке взять ракету на сопровождение потерял ее из виду. По иронии, техническая команда, которая должна была установить соответствующий патч, прибыла в Дахран 26 февраля – на следующий день после атаки.
https://fonzeppelin.livejournal.com/264312.html
Specifically, the time in tenths of second as measured by the system's internal clock was multiplied by 1/10 to produce the time in seconds. This calculation was performed using a 24 bit fixed point register. In particular, the value 1/10, which has a non-terminating binary expansion, was chopped at 24 bits after the radix point. The small chopping error, when multiplied by the large number giving the time in tenths of a second, lead to a significant error. Indeed, the Patriot battery had been up around 100 hours, and an easy calculation shows that the resulting time error due to the magnified chopping error was about 0.34 seconds. (The number 1/10 equals 1/24+1/25+1/28+1/29+1/212 +1/213+.... In other words, the binary expansion of 1/10 is 0.0001100110011001100110011001100.... Now the 24 bit register in the Patriot stored instead 0.00011001100110011001100 introducing an error of 0.0000000000000000000000011001100... binary, or about 0.000000095 decimal. Multiplying by the number of tenths of a second in 100 hours gives 0.000000095×100×60×60×10=0.34.) A Scud travels at about 1,676 meters per second, and so travels more than half a kilometer in this time.
https://www.iro.umontreal.ca/~mignotte/IFT2425/Disasters.html
https://fonzeppelin.livejournal.com/264312.html
Specifically, the time in tenths of second as measured by the system's internal clock was multiplied by 1/10 to produce the time in seconds. This calculation was performed using a 24 bit fixed point register. In particular, the value 1/10, which has a non-terminating binary expansion, was chopped at 24 bits after the radix point. The small chopping error, when multiplied by the large number giving the time in tenths of a second, lead to a significant error. Indeed, the Patriot battery had been up around 100 hours, and an easy calculation shows that the resulting time error due to the magnified chopping error was about 0.34 seconds. (The number 1/10 equals 1/24+1/25+1/28+1/29+1/212 +1/213+.... In other words, the binary expansion of 1/10 is 0.0001100110011001100110011001100.... Now the 24 bit register in the Patriot stored instead 0.00011001100110011001100 introducing an error of 0.0000000000000000000000011001100... binary, or about 0.000000095 decimal. Multiplying by the number of tenths of a second in 100 hours gives 0.000000095×100×60×60×10=0.34.) A Scud travels at about 1,676 meters per second, and so travels more than half a kilometer in this time.
https://www.iro.umontreal.ca/~mignotte/IFT2425/Disasters.html
no subject
Бооже мой, какие идиоты. И почему я каждый раз, преобразуя миллисекунды в секунды, думаю, куда округлять. А уж с вещественными числами тем более надо соображать. Ужас. Военные программисты. Контракторы хреновы.
no subject
Вообще такого, если посмотреть вглубь систем, сделанных "для государства" - очень много, причем до сих пор.
no subject
Вот я и стремался, когда, еще в Питере, для американских военных имплементировал протокол Zmodem.
no subject
https://fonzeppelin.livejournal.com/264312.html?thread=11018872#t11018872
(zmodem, ах моя молодость, бибиэски!!! :) спасибо!)
no subject
XModem, YModem, ZModem, Kermit. Это мы аутсорс лепили для Blaise Computing. Во времечко было. На 200 баксов можно было жить чуть ли не несколько месяцев.
no subject