Issue 4198: Fixed point marshalling (interop) Source: AT&T (Dr. Duncan Grisby, ) Nature: Uncategorized Issue Severity: Summary: I have a query about the intended marshalling format for Fixed. Is the sending ORB always required to transmit the number of digits specified in the IDL, or is it permitted to transmit fewer if there are leading zeros? Consider transmitting 123.45 as fixed<6,2>. Is the ORB permitted to transmit 12 34 5c or must it send the leading zero (plus another zero to pad the first octet): 00 12 34 5c In both cases, the receiving ORB knows it is expecting a scale of 2, and the sign half-octet tells it where the digits end, so it can correctly unmarshal the value as 123.45. The discussion of issue 3431 suggests that the first option is not permitted, and leading zeros must always be sent. However, the 2.4 GIOP spec makes no mention of how many digits should be sent. The specification should be clarified to either explicitly permit or explicitly forbid stripping of leading zeros. Resolution: Close with clarification revision Revised Text: Add the following clarification paragraph to the end of 15.3.2.8 Fixed-Point Decimal Type: " The number of digits present must equal the number of significant digits specified in the IDL definition for the fixed type being marshalled, with the exception of the inclusion of a leading 0x0 half octet when there are an even number of significant digits. " Actions taken: February 7, 2001: received issue October 3, 2001: closed issue Discussion: End of Annotations:===== To: issues@omg.org, interop@omg.org Subject: Fixed point marshalling From: Duncan Grisby Date: Wed, 07 Feb 2001 14:03:54 +0000 Sender: dpg1@uk.research.att.com Content-Type: text X-UIDL: /g,e9H:Rd9&3&e93k0!! I have a query about the intended marshalling format for Fixed. Is the sending ORB always required to transmit the number of digits specified in the IDL, or is it permitted to transmit fewer if there are leading zeros? Consider transmitting 123.45 as fixed<6,2>. Is the ORB permitted to transmit 12 34 5c or must it send the leading zero (plus another zero to pad the first octet): 00 12 34 5c In both cases, the receiving ORB knows it is expecting a scale of 2, and the sign half-octet tells it where the digits end, so it can correctly unmarshal the value as 123.45. The discussion of issue 3431 suggests that the first option is not permitted, and leading zeros must always be sent. However, the 2.4 GIOP spec makes no mention of how many digits should be sent. The specification should be clarified to either explicitly permit or explicitly forbid stripping of leading zeros. Cheers, Duncan. -- -- Duncan Grisby \ Research Engineer -- -- AT&T Laboratories Cambridge -- -- http://www.uk.research.att.com/~dpg1 -- Sender: jon@corvette.floorboard.com Message-ID: <3A819219.82CD0906@floorboard.com> Date: Wed, 07 Feb 2001 10:21:13 -0800 From: Jonathan Biggar X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: Duncan Grisby CC: issues@omg.org, interop@omg.org Subject: Re: Fixed point marshalling References: <200102071403.OAA29344@pineapple.uk.research.att.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: l/"!!?](!!3cc!!``d!! Duncan Grisby wrote: > > I have a query about the intended marshalling format for Fixed. Is the > sending ORB always required to transmit the number of digits specified > in the IDL, or is it permitted to transmit fewer if there are leading > zeros? > > Consider transmitting 123.45 as fixed<6,2>. Is the ORB permitted to > transmit > > 12 34 5c > > or must it send the leading zero (plus another zero to pad the first > octet): > > 00 12 34 5c > > In both cases, the receiving ORB knows it is expecting a scale of 2, > and the sign half-octet tells it where the digits end, so it can > correctly unmarshal the value as 123.45. > > The discussion of issue 3431 suggests that the first option is not > permitted, and leading zeros must always be sent. However, the 2.4 > GIOP spec makes no mention of how many digits should be sent. The > specification should be clarified to either explicitly permit or > explicitly forbid stripping of leading zeros. The second option is the correct one. There is no indication in the marshalled data stream of how many octets the fixed point type uses, so it must always use the same amount, augmented by leading or trailing zeros as necessary. -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org To: Jonathan Biggar Cc: issues@omg.org, interop@omg.org Subject: Re: Fixed point marshalling In-reply-to: Your message of "Wed, 07 Feb 2001 10:21:13 PST." <3A819219.82CD0906@floorboard.com> From: Duncan Grisby Date: Wed, 07 Feb 2001 18:29:00 +0000 Sender: dpg1@uk.research.att.com Content-Type: text X-UIDL: (bnd9E3A!!%Qh!!*@ld9 On Wednesday 7 February, Jonathan Biggar wrote: > The second option is the correct one. There is no indication in the > marshalled data stream of how many octets the fixed point type uses, > so > it must always use the same amount, augmented by leading or trailing > zeros as necessary. There _is_ an indication of how many octets it uses. The last octet must end with 0xC or 0xD. No octet in the middle of the representation can end with a half-octet greater than 0x9. I'm quite happy for the requirement to be that all digits are sent, it's just that the current specification does not make that clear. Cheers, Duncan. -- -- Duncan Grisby \ Research Engineer -- -- AT&T Laboratories Cambridge -- -- http://www.uk.research.att.com/~dpg1 -- Sender: jon@corvette.floorboard.com Message-ID: <3A8194FD.3F10DE8E@floorboard.com> Date: Wed, 07 Feb 2001 10:33:33 -0800 From: Jonathan Biggar X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: Duncan Grisby CC: issues@omg.org, interop@omg.org Subject: Re: Fixed point marshalling References: <200102071829.SAA04634@pineapple.uk.research.att.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: e#Xd9`DE!!LYJ!!';R!! Duncan Grisby wrote: > > On Wednesday 7 February, Jonathan Biggar wrote: > > > The second option is the correct one. There is no indication in the > > marshalled data stream of how many octets the fixed point type uses, so > > it must always use the same amount, augmented by leading or trailing > > zeros as necessary. > > There _is_ an indication of how many octets it uses. The last octet > must end with 0xC or 0xD. No octet in the middle of the representation > can end with a half-octet greater than 0x9. > > I'm quite happy for the requirement to be that all digits are sent, > it's just that the current specification does not make that clear. I suppose you are right, but it costs more time to search for the 0xC or 0xD than to alwas pick off the "digits" number of octets (rounded up to whole bytes.) -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org