Arduino Programming Language: Long

Name

long

Description

Datatype 'long' occupies four byte(32bit) and it stores an integer number between -2.147.483.648 and 2.147.483.647.

Syntax

long var
long var = value

Parameters

  • var: variable name
  • value: any integer number between -2.147.483.648 and 2.147.483.647

Usage

Application

Examples

long a; // It declares an integer variable 'a'

a = -232323131; // It assigns to 'a' the value -232323131

long b = 123987546; // It declares integer variable 'b' and it assigns the value 123987546

long c = a + b; //It declares a variable 'c' as the sum between other two integer variables


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc