aspose file tools*
The moose likes Beginning Java and the fly likes 99999999999 is out of range Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "99999999999 is out of range" Watch "99999999999 is out of range" New topic
Author

99999999999 is out of range

Anton Hassan
Greenhorn

Joined: Nov 15, 2003
Posts: 2
I have the following declaration:
static long MAXNUMBER = 99999999999;
Why do I get an error message: "99999999999"? Isn't the largest number for long is "(2 to the power of 63) - 1"?
I'm using Eclipse as the IDE.
Help. Thank you.
Chris Harris
Ranch Hand

Joined: Sep 21, 2003
Posts: 231
Hi Anton,
If you want to get the max value of a long use:

The max value is 9223372036854775807.
If you want to set a long to 9999999999 try

Hope that helps
Chris


SCJP 1.2, SCWCD, SCBCD
Anton Hassan
Greenhorn

Joined: Nov 15, 2003
Posts: 2
Thank you, Chris.
I wanted to make 99999999999 a long and your advice was a great help.
 
Don't get me started about those stupid light bulbs.
 
subject: 99999999999 is out of range