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

float()

Examples
float f = float(true); // sets f to 1.0
float g = float(100);  // sets g to 100.0

// equivalent to the cast operator

float f = (float) true; // sets f to 1.0
float g = (float) 100;   // sets g to 100.0
Description Converts a primitive datatype to its floating point representation. This equivalent to the cast operator (float).
Syntax
float(value)
(floatvalue
Parameters
value int, long, float, char, byte, or boolean
Returns float
Usage Application
Related float
int()
long()
char()
byte()
Updated on July 07, 2011 11:08:15pm PDT

Creative Commons License