32bit programming.

Status
Not open for further replies.

janet

Beta member
Messages
2
hi,
pls excuse me if my question is very basic, as I am not very good with programming. I am currently using a 32 bit application on my windows Xp OS. there is an unsigned long var being used in the application which I presume would not be able to hold a value more than 4294967295, yet during a calculation (when it gets multiplied by a factor of 1.5) it holds a value of 6000000000. Can ne one pls explain how ?
Also, this got me curious and i used my win XP calculator to see that I can actually key-in 32 "digits" to perform the calculation. If OS is 32 bit, how can we have a number of 32 digits length.
 
i dont think its same thing..

and i think the storage limits for variables only count for storing them, not what you calculate with them
 
i dont think its same thing..

and i think the storage limits for variables only count for storing them, not what you calculate with them

Ok. but then how the variable in my 32-bit application is storing a value of 6000000000.
Would really appreciate if you can provide an explanation.

Thanks,
Janet.
 
Ok. but then how the variable in my 32-bit application is storing a value of 6000000000.
Would really appreciate if you can provide an explanation.
You're assuming that the application is storing the number as a 32-bit value since the size of the processor register is 32 bits. From your simple experimentation, you can observe that this is not happening. The topic of storing values is usually discussed in computer architecture classes and can be quite involved. However, just do a search for "arbitrary precision arithmetic" for an example of how an application can work with huge numbers.
 
Status
Not open for further replies.
Back
Top Bottom