[Cfp-interest] CFP binary FP

Fred J. Tydeman tydeman at tybor.com
Fri Dec 9 12:59:49 PST 2011


On Fri, 9 Dec 2011 11:14:07 -0800 Jim Thomas wrote:
>
>> A domain error occurs is x is zero, infinite, or NaN.
>> If the correct value is outside the range of the return type, a domain
>> error occurs and the numeric result is unspecified.
>
>I'm wanting to be careful about mixing something that should be in a C1x DR 
>into the CFP TS.

I tried to get this fixed in C99 via DR 240 back in 2001.  While some changes 
were done, the committee did not vote to do everything.

We can try again for C11.

In the meantime, our CFP document should have the correct wording.

>>>> How get range error for fsqrt?
>>>> 
>>> fsqrt(DBL_MAX), for example
>> 
>> I think not.  The exponent of the sqrt is 1/2 of the exponent of
>> the argument.  So, overflow or underflow cannot happen.
>
>fsqrt has to deliver a float result. The square root of DBL_MAX won't fit in 
>float.

You are correct.  I am not used to these new function names and
their semantics.

>>>> ISSUE:  If fesetexcept() cannot cause a trap, do we need to add words 
>>>> to feraiseexcpet() that it can cause a trap?
>>>> Do we need to add words that flags have 3 states:
>>>> clear
>>>> raised (causing a trap)
>>>> set (not causing a trap)
>>>> 
>>>> 
>>> raise and set (using C terminology) put the flags in the same state. 
>>> The difference is that raise may cause side effects, namely traps.
>> 
>> Then, there should be words about these side effects.
>
>There are. See new footnote 4 and the footnote for feraiseexcept in C1x.

OK.

>> Also, does the order of raising and enabling a trap matter?
>> Or, are those words going to happen in part 5 (which I assume
>> is the part that will discuss trapping (alternate exceptions))?
>
>I assume you're worrying about deferred traps. I thought we concluded that 
>that was an implementation issue.

Is that documented in either a standard, tech report, or rationale?


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (775) 358-9748      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