Integer overflow: Difference between revisions

Content deleted Content added
Added semicolon in a run-on sentence.
Tags: Mobile edit Mobile web edit
Examples: style and source - the bug was fixed in later Civs
Line 136:
On 30 April 2015, the [[Federal Aviation Authority]] announced it will order [[Boeing 787]] operators to reset its electrical system periodically, to avoid an integer overflow which could lead to loss of electrical power and [[ram air turbine]] deployment, and Boeing deployed a [[software update]] in the fourth quarter.<ref>{{cite news |title= F.A.A. Orders Fix for Possible Power Loss in Boeing 787 |first=Jad|last=Mouawad|work= [[New York Times]] |date= 30 April 2015 |url= https://www.nytimes.com/2015/05/01/business/faa-orders-fix-for-possible-power-loss-in-boeing-787.html?_r=0}}</ref> The [[European Aviation Safety Agency]] followed on 4 May 2015.<ref>{{cite web |url= http://ad.easa.europa.eu/ad/US-2015-09-07 |work= Airworthiness Directives |title= US-2015-09-07 : Electrical Power – Deactivation |date= {{date|2015-05-04}} |publisher= [[European Aviation Safety Agency]]}}</ref> The error happens after 2³¹ centiseconds ({{#expr:2^31/100/3600/24}} days), indicating a 32-bit [[Signed number representations|signed]] [[Integer (computer science)|integer]].
 
Overflow bugs are evident in some computer games. In the arcade game ''[[Donkey Kong (video game)|Donkey Kong]]'', [[Kill screen|it is impossible to advance past level 22]] due to an integer overflow in its time/bonus. The game takes the level number a user is on, multiplies it by 10 and adds 40. When they reach level 22, the time/bonus number is 260, which is too large for its 8-bit 256 value register, so it resets itself to 0 and gives the remaining 4 as the time/bonus – too short to finish the level. In ''[[Donkey Kong Jr. Math]]'', when trying to calculate a number over 10000, it shows only the first 4 digits. Overflow is the cause of the famous ''[[kill screen|Split"split-screen" Screenlevel]]'' in ''[[Pac-Man]]''<ref>{{cite web|url=http://home.comcast.net/~jpittman2/pacman/pacmandossier.html|title=The Pac-Man Dossier|author=Pittman, Jamey}}</ref> and the ''"Nuclear Gandhi''" in [[Civilization series(video game)|''Civilization'']].<ref>{{cite web |url=https://kotaku.com/why-gandhi-is-such-an-asshole-in-civilization-1653818245 |title=Why Gandhi Is Such An Asshole In Civilization |last=Plunkett |first=Luke |date=2016-03-02 |website=[[Kotaku]] |publisher= |access-date=2018-07-30 |quote=}}</ref> It also caused the "Far Lands" in ''[[Minecraft]]'' which existed from the Infdev development period to Beta 1.7.3,; however, it was later fixed in Beta 1.8 but still existexists in the Pocket Edition and Windows 10 Edition versions of ''Minecraft''.<ref>{{cite web|url=http://minecraft.gamepedia.com/Far_Lands|title=Minecraft Gamepedia Page|author=Minecraft Gamepedia}}</ref>
 
[[File:Error message due to an integer signedness bug in the stack setup code of MASM 1.00.gif|thumb|An integer signedness bug in the stack setup code emitted by the Pascal compiler prevented Microsoft / IBM MACRO Assembler Version 1.00 (MASM), a DOS program from 1981, and many other programs compiled with the same compiler, to run under some configurations with more than 512 KB of memory.]]