[This message was posted by Rolf Andersson of Pantor Engineering 
<[email protected]> to the "FAST Protocol" discussion forum at 
http://fixprotocol.org/discuss/46. You can reply to it on-line at 
http://fixprotocol.org/discuss/read/0fc24457 - PLEASE DO NOT REPLY BY MAIL.]

Shek,

the short answer is yes (if I have understood your questions)

As an FAQ response for other readers:

The delta value transferred is always signed even if the field is unsigned 
(this is logical, otherwise it would only be possible to increase the value of 
a field). [section 6.3.7]

Let's assume that you have an unsigned field 'x' and let's further assume that 
we are encoding three values [100, 120, 115].

We need to keep track of three quantities:
base - the previous value
wire - the delta quantity transferred on the wire
data - the data value for field 'x'

Both the encoder and decoder keep track of the 'base' value.

The encoder calculates 'wire = data - base'.
It then updates base; 'base = data'.

The decoder calculates 'data = base + wire'.
It then updates base; 'base = data'.

When we start the base value is zero [section 6.3.7.1].

data=100 => base=0 + wire=100 => 100
data=120 => base=100 + wire=20 => 120
data=115 => base=120 + wire=-5 => 115

So, transferring [100, 120, 115] using delta coding produces the wire values 
[100, 20, -5] 

The same procedure is used for signed integers with the difference that data 
values can take negative values in the signed case.

Hope this helps,
Rolf

> Can someone please clarify if operations such as the delta
> operation will return signed or unsigned integers?

> Does the operation always return the same data type as that
> which it is being used upon?


[You can unsubscribe from this discussion group by sending a message to 
mailto:[email protected]]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Financial Information eXchange" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/FIX-Protocol?hl=en
-~----------~----~----~----~------~----~------~--~---

  • [FIX] Re: Data types returned f... 'FAST Protocol' forum at fixprotocol . org

Reply via email to