1
Considering that answer in Soen would like to know what the nomenclature of when it occurs to try to store a value greater than the type unsigned int
can contain as the result will be module UINT_MAX
. Do you have any specific nomenclature when it occurs that the variable does not have the value assigned to it? It has specific nomenclature when the type is unsigned int
?
The nomenclature would be "defined behavior:)"
– epx
defined behavior It’s a lot, not only this.
– Maniero
@epx but
1+1
andUINT_MAX + 1
are not both defined behavior?– Mateus -- O Schroeder
"defined behavior" is simply "definite behavior" in English, and does not need to be read as a technical term (although those huge glossaries defining terms that head some "RFC" type documents may have the expression). It is simply a "defined behavior" in the language specification that the number in question "goes around", and the value of NUM % (MAX_NUM + 1) is assigned the variable.
– jsbueno
But it makes sense to use "overflow" when one is interested to know that the result did not fit in the destination, without taking into account the implication of this, and "wrap Around" describes precisely the implication of this in C. In another language the consequence of "overflow" could be an exception of "Valueerror", and so on.
– jsbueno