Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Range of Data Type double

 
Senthamizh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per the Book, long Data Types Range is -9223372036854775808 to 9223372036854775807. Ex. long l = 9223372036854775807.
I got an error message while compiling this above statement.The Error message is : "integer number too large: 922337203685477580"
Why?
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Senthamizh
To make it a long you need to put an L at the end of the assignment statement:
long l = 9223372036854775807L;
that should take care of it for you. Without the L the compiler thought it was an int.
hope that helps


------------------
Dave
Sun Certified Programmer for the Java� 2 Platform
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic