[Cfp-interest] C binding for IEEE 754-2008

Jim Thomas jaswthomas at sbcglobal.net
Tue Aug 7 09:22:27 PDT 2012


On Aug 6, 2012, at 11:51 PM, Mike Cowlishaw wrote:

> OK, thanks .. sounds as though the string conversion was worth discussion.  One definitely wants printf to show the 'quantum effects' by default.  On another reading of this part of the 'a' formatting:
>  
>     • if 0 >= q >= -(n+5), use style f formatting with formatting precision equal to -q,
>  
> Perhaps it is the bit in red that 'does the right thing'?  Anyway, worth being very explicit about the intent, I suggest.

I added this at the beginning of 11.5:

With the following decimal forms of the a,A format specifiers, the printf family of functions provide conversions to decimal character sequences that preserve quantum exponents, as required by IEC 60559. 
   
>  
> And an Editor's nitpick :-)  what's that character before the left parenthesis and the final q in that line?  See: http://speleotrove.com/decimal/decifaq2.html#minuses 

Right. I changed the one you noted and the "n - 1" in the next line. What are your thoughts about unary minus? Exponent signs, as in 123e-4? The ones in the document look ok to me.

-Jim

>  
>  
> Mike
> 
> From: Jim Thomas [mailto:jaswthomas at SBCGLOBAL.NET] 
> Sent: 06 August 2012 21:57
> To: Mike Cowlishaw; CFP
> Subject: Re: C binding for IEEE 754-2008
> 
> Mike, thanks for the comments. Please see responses below - also sent to the CFP study group.
> 
> -Jim
> 
> On Aug 6, 2012, at 2:34 AM, Mike Cowlishaw wrote:
> 
>> Hi Jim,
>>  
>> I have read through the Part 2 draft and also Fred's comments -- it is all looking very good.  I have only a few minor comments, with perhaps the last one being the most significant:
>>  
>> Comments on WG14 Study Group Draft (cfp2) -- July 22, 2012
>>  
>> PDF page 5, para 3: this paragraph might be confusing to later
>>   readers, because z/Architecture machines have had floating point
>>   decimal units for around 5 years and so "This, however, provides
>>   integer arithmetic only" is incorrect.  Perhaps something like
>>   "Prior to the IBM System z10 processor, however, this provided
>>   integer arithmetic only"?
> Ok.
>>  
>> PDF page 10: in the table the values for Emax and Emin are different
>>   from the emax and emin values in IEC 60559 -- presumably a
>>   different definition is used in C11.  Worth a footnote to warn the
>>   reader?  The reader is referred to IEC 60559 for semantics, but
>>   using Emax instead of emax would give incorrect results.
> The mismatch between the IEC 60559 and C models is indeed confusing. Yes, a footnote warning about the difference might be helpful.
>>  
>> PDF page 17, table: 'IEEE 754' should be 'IEC 60559'?
> Right.
>>  
>> PDF pages 29-30: I'm not familiar with the definition of "style f
>>   formatting" in C11, but it is worth emphasising that conversions to
>>   strings (in printf for example) rpreserve th quantum.
> Style-f formatting doesn't generally preserve the quantum exponent. The decimal a,A formatting does though.
>>  
>>   Perhaps add to the examples on page 30 some where c ends in 0,
>>   e.g.:
>>  
>>     ( 1, 120, -8) 0.00000120
>>     ( 1, 120, -9) 1.20e-7
> Good.
>>  
>>   In other words, a 'default' conversion from a _Decimal to a string
>>   and back to the same type of _Decimal must result in a _Decimal
>>   that is identical in (s, c, q) to the original.
> Assuming by 'default' you mean default a,A conversion.
> 
>> Also, it might be worth adding this link to your Wiki:  http://speleotrove.com/decimal/
> 
> Agreed
> 
>>  
>> Feel free to forward this to the working group.   I'd be happy to reply to any specific questions, etc.
>>  
>> Cheers -- Mike
>>  
>>  
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20120807/4fc2898c/attachment-0001.html 


More information about the Cfp-interest mailing list