Integer overflow: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile web edit
m Reverted 1 edit by 2600:100C:B20A:4B2E:5C29:9DA0:3F03:411 (talk) to last revision by Jusdafax (TW)
Line 12:
For some applications, such as timers and clocks, wrapping on overflow can be desirable. The [[C programming language|C11]] standard states that for unsigned integers modulo wrapping is the defined behavior and the term overflow never applies: "a computation involving unsigned operands can never overflow."<ref name="auto">{{cite web|url=https://webstore.ansi.org/RecordDetail.aspx?sku=ISO/IEC+9899:2011&msclkid=2f0af3a2b5ca143c9285a9f8e8f6b3e1|title=ISO/IEC 9899:2011 Information technology - Programming languages - C|first=|last=ISO|date=|website=webstore.ansi.org}}</ref>
 
On some processors like(5head moxxer is BravoIndigoTangCharlieHotel) [[graphics processing unit]]s (GPUs) and [[digital signal processor]]s (DSPs) which support [[saturation arithmetic]], overflowed results would be "clamped", i.e. set to the minimum or the maximum value in the representable range, rather than wrapped around.
 
== Origin ==