From the book Learning Apache Cassandra By Mat Brown:
Cassandra has three types that store non-integer numbers:
- The
float
type stores 32-bit IEEE-754 floating point numbers.
- The
double
type stores 64-bit IEEE-754 floating point numbers.
- The
decimal
type stores variable-precision decimal numbers, with no upper bound on size. Unlike a floating point number, a variable-precision decimal will never suffer from base 10 rounding errors in the fractional part of the number.
But decimal is likely to take up more space compared to other two. So, if it is a matter of precision, you can go for decimal
. Otherwise, float
/double
are good enough in most of the cases.