[b]Question asked by visitor sesi[/b]
Can anybody specifically (in figures) tell me about the ranges for each and every datatypes in java?
Printable View
[b]Question asked by visitor sesi[/b]
Can anybody specifically (in figures) tell me about the 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
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