[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Photuris // Variable-Precision numbers
I wrote in a previous note:
> Page 11: Section 2.5 Variable Precision Numbers
>
> It seems possible that a variable-precision number could have
> a size of 0 octets. Indeed, many of the examples given have
> exactly that (e.g. the Validity-Choice field on pages 27--28 are
> shown as 16-bits, which must be a size of 0). Yet the value
> of such a quantity is undefined. Is it 0?
>
To which Bill Simpson replied:
>Yes. Fixed:
>
> A value of zero is represented by a Size of zero, and no value field.
>
> A value of one is represented by a Size of one, and no value field.
and now I'm confused.
Representing a value of one by a Size of one, and no value field, is
inconsistent with the purpose of the Size field, and rules out the
possibility of having a Size field of one with a real value field of length
one. (I am interpreting the Size field to mean the length of the Value
field only; the 2 bytes of the Size field are not counted.)
What you want is something like (bytes given in hex):
Size Value Represents (decimal)
00 0
01 00 0
01 01 1
01 02 2
...
01 FF 255
02 00 00 0
02 00 01 1
...
02 FF FF 65535
and so on.
Correct?