Talk:Variable size/Set

From Rosetta Code
Revision as of 15:53, 25 May 2009 by rosettacode>PauliKL (Needs clarification and fixing the examples)

I'm not sure quite what this is asking. It sounds like declaring a specific size for a variable, such that the implementation is required to make it at least that big, but the programs so far seem to be focused on making 0- or 1-bit data types. Clarification?

Indeed, the descriptions is vague. I agree that the purpose is probably to declare a variable that contains at least so many bits, so that the programmer can be sure that the data will fit in the variable. The C example seems to be the only one that implements the required task. Others seem to be attempting to specify as small variable as possible.
On the other hand, in most languages it is not necessary to specify the minimum size, since the size of each type is always known. Specifying minimum size is only needed if the size of a type (for example int) is different in different implementations (as it is in C). --PauliKL 15:53, 25 May 2009 (UTC)