Skip to content

Floating point number type object

Philippe Proulx edited this page Sep 10, 2020 · 3 revisions

A CTF floating point number type.

See also: Type object.

Properties

Property Type Description Required? Default value
class String Set to flt, float, or floating-point Required N/A
size Floating point number type size object Size parameters Required N/A
align Integer (positive) Alignment (bits) (power of two) Optional 8
byte-order String Byte order, amongst:
  • le: little-endian
  • be: big-endian
Optional Native byte order defined in the Trace object

All the properties which have a default value can also be set to null to force this default value. This is especially useful when also using type inheritance or when including external YAML files.

Example

class: float
size:
  exp: 11
  mant: 53
align: 64
byte-order: be

Generated C type

  • 8-bit exponent, 24-bit mantissa, 32-bit alignment: float
  • 11-bit exponent, 53-bit mantissa, 64-bit alignment: double
  • Other combination: uint64_t

Floating point number type size object

The CTF floating point number type is encoded, in a binary stream, following IEEE 754-2008's interchange format. The required parameters are the exponent and significand sizes, in bits. In CTF, the mantissa size includes the sign bit, whereas IEEE 754-2008's significand size does not include it.

Properties

Property Type Description Required? Default value
exp Integer (positive) Exponent size (bits) Required N/A
mant Integer (positive) Mantissa size (significand size + 1) (bits) Required N/A

As per IEEE 754-2008, the sum of the exp and mant properties must be a multiple of 32.

The sum of the exp and mant properties must be lesser than or equal to 64.

Example

exp: 8
mant: 24