posted 11 years ago
Hello friend,
I have some doubt in long datatype, As i know any long datatype can store max value 9223372036854775807 which i calculated to be 63 bit long only. But by default long datatype can store 64 bit value and max capacity should be 18446744073709551615. I wanted to store 64 bit value(18446744073709551615) in long datatype but it is not being accepted.
long ts=18446744073709551615L;
It is giving error like "Integer number too large".
I have some doubt in long datatype, As i know any long datatype can store max value 9223372036854775807 which i calculated to be 63 bit long only. But by default long datatype can store 64 bit value and max capacity should be 18446744073709551615. I wanted to store 64 bit value(18446744073709551615) in long datatype but it is not being accepted.
long ts=18446744073709551615L;
It is giving error like "Integer number too large".
posted 11 years ago
The long data type is a 64bit signed two's complement integer. It has a minimum value of 9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive).
You're right that is can store 9223372036854775807 different numbers. Since half of them are negative, only half of them can be positive.
You're right that is can store 9223372036854775807 different numbers. Since half of them are negative, only half of them can be positive.
Best regards,<br />Mattias
RajendraKr Kumar
Greenhorn
Posts: 6
I yam what I yam and that's all that I yam  the great philosopher Popeye. Tiny ad:
The WEB SERVICES and JAXRS Course
https://coderanch.com/t/690789/WEBSERVICESJAXRS
