Aller au contenu principal

8. Diagnostic Notation (Notation Diagnostique)

8.1. Encoding Indicators (Indicateurs d'Encodage)​

La notation diagnostique (Diagnostic Notation) est une représentation lisible par l'homme des éléments de données CBOR.

Notations principales:

  • Entiers: 0, 23, -1
  • Chaînes d'octets: h'01020304' (hexadécimal)
  • Chaînes de texte: "Hello"
  • Tableaux: [1, 2, 3]
  • Cartes: {1: "a", 2: "b"}
  • Éléments balisés: 1(1234567890) (numéro de balise(contenu))
  • Valeurs simples: false, true, null, undefined

8.2. Diagnostic Notation for Floating-Point Numbers (Notation Diagnostique pour les Nombres à Virgule Flottante)​

Représentation des nombres à virgule flottante:

  • Notation décimale: 1.5, -273.15
  • Notation exponentielle: 1.5e+10
  • Valeurs spéciales: Infinity, -Infinity, NaN

8.2.1. Encoding Indicators for Floating-Point Numbers (Indicateurs d'Encodage pour les Nombres à Virgule Flottante)​

Suffixes pour indiquer une précision spécifique en virgule flottante:

  • _1: demi-précision (16 bits)
  • _2: simple précision (32 bits)
  • _3: double précision (64 bits)

Exemples:

  • 1.5_1: 1.5 encodé en demi-précision
  • 1.5_2: 1.5 encodé en simple précision