Framework (A-Z)

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Name

int()

Examples
int i = int(245.456);  // sets i to 245

// equivalent to the cast operator

int i = (int) 245.456; // sets i to 245
Description Converts a primitive datatype to its integer representation. This equivalent to the cast operator (int).
Syntax
int(value)
(intvalue
Parameters
value int, long, float, char, byte or boolean
Returns int
Usage Application
Related int
long()
float()
char()
byte()
Updated on July 07, 2011 11:08:24pm PDT

Creative Commons License