Float

The float data type is used for storing single-precision decimal numbers (floating-point numbers).

float price = 19.9f;
float temperature = 36.f;
  • Is less precise than double, but occupies less memory.
  • Occupies 4 bytes (32 bits).
  • Is typically used when you need to save memory in large arrays of floating-point numbers.

Related concepts

Float — Structure map

Clickable & Draggable!

Float — Related pages: