I've never come across such variable types in python(even though I am still a beginner in python and have just started C).
I've come across variable types in C and am confused at the point where the range of values are given like this. I've made the following deductions:
The storage size is the amount of space that the specific type of variable can hold. But regarding the value range I have a lot of doubts:
I think the value range is the integer upto which we can enter into the specific variable:
Example:
I think for signed char the storage size is 1 byte and we could not enter variable1 = 128, but I was wrong when I compiled the simple program;
#include <stdio.h>
int main(void)
{
signed char variable1;
variable1 = 128;
printf("the value is: %d", variable1);
return 0;
}
The output of the compiler(using dev C++) was :
-127
So I thought It would start from the minimum once it crossed it's range and produce an error after 255 and I was right. The same was true for the type short int from type -32,768 to 32,767. But, this failed for the type int -2,147,483,648 to 2,147,483,647. It continued to accent.
Therefore, my whole perspective about the value ranges went to nought. It might be something more complex than I had imagined. So what is the value range of variables, and how can we interpret all of these weird results?
EDIT1: I edited to upload my experiments: