function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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