[Cfp-interest 1610] Re: TS3 annex review: encodefN / decodefN

Fred J. Tydeman tydeman at tybor.com
Tue Jun 2 20:23:11 PDT 2020


On Mon, 25 May 2020 17:15:24 -0700 Jim Thomas wrote:
>
>Look for all sorts of errors, technical and editorial. Send comments to me and cc the review team. I'm proposing you complete your review and send comments by Monday, June 8.
>

Question about encodefN/decodefN.  The existing text has:

X.11.3.1.1The encodefN functions
[2] The encodefN functions convert *xptr into an IEC 60559 binaryN
encoding and store the resulting encoding as an N/8 element array,
with 8 bits per array element, in the object pointed to by encptr. 

X.11.3.1.2 The decodefN functions
[2] The decodefN functions interpret the N/8 element array pointed to
by encptr as an IEC 60559 binaryN encoding, with 8 bits per array
element.


Now, what if the unsigned char array as input (to decode) has some
random bits such that it does not correspond to an IEC 60559 binaryN
value?

Or, if the input to encode is not an IEC 60559 binaryN value?

For example, Intel x87 has floating-point encodings that are not part
of IEC 60559.

Perhaps, these functions (and similar ones) need to return an int to
indicate that the input is not a valid IEC 60559 value.


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list