|
-
Jun 9th, 2002, 09:03 AM
#1
Thread Starter
Member
-
Jun 9th, 2002, 04:10 PM
#2
Lively Member
Are you really talking about floats? floating point numbers?
I'm asking this because the max value for a single precision floating point number is
3.402823E38
which isn't related to 2^32 in any way...
Are you sure you're not talking about 4 byte integers? (long or double depending on the language)
-
Jun 9th, 2002, 04:43 PM
#3
Yeah, if dealing with real floating point values, its wrong. if dealing with integer values:
The answer is because you are using a signed value. 4 bytes == 32 bits. If you were to use all 32 bits, you would have 2^32. But, since you are using a signed value, one bit is used as the sign bit, leaving only 31 bits, 2^31. The -1 comes from the fact that 0 is positive, so you cannot store the value 2^31. Since 0 is not negative, you CAN store -2^31.
Z.
-
Jun 9th, 2002, 04:44 PM
#4
In what language is a double an integer value?
Z.
-
Jun 9th, 2002, 04:55 PM
#5
Stuck in the 80s
Originally posted by Zaei
In what language is a double an integer value?
Z.
Spanish.
-
Jun 9th, 2002, 05:45 PM
#6
Thread Starter
Member
Thanks Zaei !
I can understand now ! Cool !!
He really asked for a 4Byte float - checked it again !
Don't know if he refered to C++ ? (What we're doing )
Thanks !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|