8. Diagnostic Notation (診断記法)
8.1. Encoding Indicators (エンコーディングインジケーター)
診断記法 (Diagnostic Notation) は、CBOR データ項目の人間可読表現です。
主要な表記法:
- 整数:
0,23,-1 - バイト文字列:
h'01020304'(16 進数) - テキスト文字列:
"Hello" - 配列:
[1, 2, 3] - マップ:
{1: "a", 2: "b"} - タグ付き項目:
1(1234567890)(タグ番号(コンテンツ)) - 簡易値:
false,true,null,undefined
8.2. Diagnostic Notation for Floating-Point Numbers (浮点数の診断記法)
浮点数表現:
- 十進表記:
1.5,-273.15 - 指数表記:
1.5e+10 - 特殊値:
Infinity,-Infinity,NaN
8.2.1. Encoding Indicators for Floating-Point Numbers (浮点数のエンコーディングインジケーター)
特定の浮点精度を示すサフィックス:
_1: 半精度 (16 ビット)_2: 単精度 (32 ビット)_3: 倍精度 (64 ビット)
例:
1.5_1: 半精度としてエンコードされた 1.51.5_2: 単精度としてエンコードされた 1.5