1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

doc: add range for integer/long integer objects, add examples with negative numbers (relay protocol)

This commit is contained in:
Sebastien Helleu
2013-03-13 12:25:57 +01:00
parent d74041de25
commit 81cc688166
+22 -8
View File
@@ -1193,11 +1193,17 @@ Integer
A signed integer is 4 bytes, encoded as big-endian format (most significant byte
first).
Example:
Range: -2147483648 to 2147483647.
Examples:
.......................................
┌────┬────┬────┬────┐
│ 00 │ 000104 │ ────► 260 (0x104)
│ 00 │ 01E2 │ 40 │ ────► 123456
└────┴────┴────┴────┘
┌────┬────┬────┬────┐
│ FF │ FE │ 1D │ C0 │ ────► -123456
└────┴────┴────┴────┘
.......................................
@@ -1207,14 +1213,22 @@ Long integer
A signed long integer is encoded as a string, with length on one byte.
Example:
Range: -9223372036854775808 to 9223372036854775807.
Examples:
.......................................
┌────╥────┬────┬────┐
│ 03 ║ 32 │ 36 │ 30 │ ────► 260
└────╨────┴────┴────┘
└──┘ └────────────┘
length '2' '6' '0'
┌────╥────┬────┬────┬────┬────┬────┬────┬────┬────┬────
│ 0A ║ 31 │ 32 │ 33 │ 34 │ 35 │ 36 │ 37 │ 38 │ 39 │ 30 │ ────► 1234567890
└────╨────┴────┴────┴────┴────┴────┴────┴────┴────┴────
└──┘ └───────────────────────────────────────────────
length '1' '2' '3' '4' '5' '6' '7' '8' '9' '0'
┌────╥────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┐
│ 0B ║ 2D │ 31 │ 32 │ 33 │ 34 │ 35 │ 36 │ 37 │ 38 │ 39 │ 30 │ ────► -1234567890
└────╨────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┘
└──┘ └────────────────────────────────────────────────────┘
length '-' '1' '2' '3' '4' '5' '6' '7' '8' '9' '0'
.......................................
[[object_string]]