[This message was posted by jason braswell of allston trading <[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/b0f0f98d - PLEASE DO NOT REPLY BY MAIL.]
Good answer. Just in case this is the sort of thing that is driving someone nuts, though, I believe the right section is 10.7.1 (although it *should* have been 6.3.7). > 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 -~----------~----~----~----~------~----~------~--~---
