Arduino Programming Language: Float

Name

float

Description

Float is used to declare floating-point numbers (decimal number). They are useful because they have greater resolution than integers. 
They are stored as 32 bits (4 bytes), so they can be as large as 3.4028235E+38 and as low as -3.4028235E+38

Syntax

float foo
float foo = value

Parameters

  • foo: name of the variable
  • value: a floating-point number

Returns

none 

Usage

Application

Examples

float a = 3.1415;
float b = -4.5;


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