Now you may wonder whether we can mathematically prove swapping two variavles requires memory of three variables in digital computer...
Now you may wonder whether we can mathematically prove swapping two variavles requires memory of three variables in digital computer...
I'd still be curious about any theories of storage.
It works for integers (and pointers)
[1] Actually multiple of sizeof(char), where sizeof(char) is defined as 1. And that's technically not 1 byte everywhere, but most of the time nowadays it is.
Telling someone who doesn't know what widening a variable means that they meant widening a variable without explaining what widening a variable means helps no one.
(Plus adding 1 bit to the "bit size" of a variable _does_ double the base 10 size of the variable if you want to be really pedantic)
This is consistent with other uses: The size of an array, the size of a data structure in general, the size of a file... In all of those you are concerned about how much memory or disk space is taken.
So I think calling the range "size" is counterintuitive and gives the wrong idea, and I do not agree that the "base 10 size" of a variable is equivalent to its range. (What does "base 10" have to do with it anyway? The range is doubled no matter what base we're operating in.)