NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
float

In NXC the float type is a 32-bit IEEE 754 single precision floating point representation.

This is a binary format that occupies 32 bits (4 bytes) and its significand has a precision of 24 bits (about 7 decimal digits).

Floating point arithmetic will be slower than integer operations but if you need to easily store decimal values the float type is your best option. The standard NXT firmware provides the sqrt function which benefits from the ability to use the float type. In the enhanced NBC/NXC firmware there are many more native opcodes from the standard C math library which are designed to work with floats.

float pi = 3.14159;
float e = 2.71828;
float s2 = 1.4142;