O'Reilly logo

Mastering Arduino by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Long

The long data type can store integers from -2,147,483,648 to 2,147,483,647. The following code shows how we would define a long variable:

long myLong = 123,456,789; 

In the preceding code, we declared a variable named myLong of the long type and gave it a value of 123,456,789. It is good practice to avoid using the long data type unless it is necessary to store larger numbers because it uses more memory than the integer type.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required