This is easier since java defaults to 32-bit integers:

long myvalue = 1021888800000000002L; or
                        1021888800000000002l;

Using the "l/L" indicates to use 64-bit

Brian

Chen, Gin wrote:

This is not an issue with the long but rather the actual number you wrote
in.
Try this instead

long myvalue = Long.parseLong("1021888800000000002");

-Tim

-----Original Message-----
From: Benoit Jodoin [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 2:52 PM
To: [EMAIL PROTECTED]
Subject: assigning a value to a long type variable


I know it might sound like a weird/simple question...but here's my problem :

that's what im trying to do

long myvalue = 1021888800000000002;
this value is way smaller than Long.MAX_VALUE...

here's the compilation error i get at runtime:

Integer literal out of range.  Decimal
int literals must be in the range -2147483648 to 2147483647.
long myvalue = 1021888800000000002;
              ^

there must be a way to do it?

Regards

Ben




-- Benoit Jodoin <[EMAIL PROTECTED]> Vertical 7

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com



=========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com

Reply via email to