Floating Numbers

Carbon TypeDescriptionSizenull-ValueMarker
floatsingle-precision floating number4 bytenull or NANr

Encoding as Field Value

DescriptionSizeMarkerPayload
32-bit floating number1+4 bytes[r] (real)a float value

Example

JSON snippet

[23.3, 42.0]

A (compacted) Carbon file, which encodes the JSON array as array of one i8 and one u8 integer.

[[] [r][23.3] [r][42.0] []]

Encoding as Column Value

Column Type MarkerElement SizeBlock
[R], 32-bit floating numbers4 byte eacha float value

Example

JSON snippet

[23.3, 42.0]

A (compacted) Carbon column-float.

[R] (2)(2) [23.3][42.0]