-
Ranges for each and every datatypes in Java
Question asked by visitor sesi
Can anybody specifically (in figures) tell me about the ranges for each and every datatypes in java?
-
Junior Member
Re: Ranges for each and every datatypes in Java
we have an formula for calculating the data types.
for lower range is -2 to the power of(bits-1) to 2 to the power of (bits-1) -1
-
Contributing Member
Re: Ranges for each and every datatypes in Java
Primitive Type Size Range of Values
byte 8 bit -2^7 to 2^7-1
16 bit -2^15 to 2^15-1
int 32 bit -2^31 to 2^31-1
long 64 bit -2^63 to 2^63-1
char 16 bit '\u0000' to '\uffff'(0 to 2^16-1 )
float 32 bit Max. positive value: (2-2^-23)*2^127. Min. positive value: 2^-149
double 64 bit Max. positive value: (2-2^-52)*2^1023. Min. positive value: 2^-1074
Last edited by neelim; 04-05-2007 at 04:28 AM.
Reason: Formatting
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