Names and Aliases
| Name | Aliases |
|---|---|
FLOAT | None |
REAL | FLOAT4 |
DOUBLE PRECISION | FLOAT8 |
Syntax
A constant value of typeFLOAT can be entered as a .
For example: 1.414 or -1234.
The special IEEE754 values for positive infinity, negative infinity
and NaN (Not-a-Number) cannot be
entered using numeric literals directly and must be converted using an
or an
from a string literal instead.
The following values are recognized:
| Syntax | Value |
|---|---|
inf, infinity, +inf, +infinity | +∞ |
-inf, -infinity | -∞ |
nan | NaN (Not-a-Number) |
FLOAT '+Inf''-Inf'::FLOATCAST('NaN' AS FLOAT)
Size
AFLOAT column supports values up to 8 bytes in width, but the total storage size is likely to be larger due to CockroachDB metadata.
Examples
Supported casting and conversion
FLOAT values can be to any of the following data types:
| Type | Details |
|---|---|
INT | Truncates decimal precision and requires values to be between -2^63 and 2^63-1 |
DECIMAL | Causes an error to be reported if the value is NaN or +/- Inf. |
BOOL | 0 converts to false; all other values convert to true |
STRING | — |

