+ Start a Discussion
sroberts_MEsroberts_ME 

Long max value

The max for a long is 2^63 >> 99,999,999,999

 

Long max = 99999999999;

 

Error: Compile Error: Invalid Integer: 99999999999

 

WHY? its not an integer, at all. It is within the limits for the data type...

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

Try this :

 

Long l = 99999999999L ;

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Jake GmerekJake Gmerek

From this Link:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_primitives.htm

 

Integer	A 32-bit number that does not include a decimal point. Integers have a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647. For example:
Integer i = 1;

 

sroberts_MEsroberts_ME

It is NOT an int, it is a long.

Jake GmerekJake Gmerek

I'm sorry, your right, I read the error message and it stuck with me.  That seems odd, it appears that it should work.

Ankit AroraAnkit Arora

Try this :

 

Long l = 99999999999L ;

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer