FAST Specification: Does ASCII String Delta really have "subtraction length" as Signed Integer?

FAST specification, in the item 10.7.3 ASCII String Delta, says:

The delta value is represented as a Signed Integer subtraction length followed by […].

The item 10.6.1.1 Signed Integer says:

The entity value is a two’s complement integer representation […]

But the Appendix 3.2.5 FAST v1.1 Delta Operator Examples, EXAMPLE 4 uses a negative zero.

The problem is: There is no negative zero in two’s complement integer representation. There is only zero.

Can anyone help me understand this? The example seems to use something other than two’s complement. For instance, -2 in twos complement should be 1…110, the example represents -2 as 1…1101 that is actually -3 in twos complement.

See section 6.3.7.3:

The subtraction length uses an excess-1 encoding: if the value is negative when decoding, it is incremented by one to get the number of characters to subtract. This makes it possible to encode negative zero as -1, which can be used to encode an operation that adds to the front without removing any characters.

-2 is encoded as -3 and -0 is encoded as -1.

2 Likes