[Cfp-interest] Pole errors action item result

Jim Thomas jaswthomas at sbcglobal.net
Wed Apr 9 11:29:34 PDT 2014


The definition of pole error is stated in terms of the mathematical function, not the implementation of that function. The mathematical function either has a pole error or it doesn’t, regardless of how the function is implemented.

The definition of domain error is similar in this respect. Function specifications say "domain error occurs", not "domain error may occur”, in most cases, though not all.

The definition of range error doesn’t actually refer to the “mathematical function”: “a range error occurs if the mathematical result of the function cannot be represented in an object of the specified type, due to extreme magnitude”. However, I read this the same as if it said “the result of the mathematical function” instead of “the mathematical result of the function”. Implementations aren’t generally expected to precisely determine overflow thresholds (for the format). Hence, the function specifications are imprecise, for example, "A range error occurs if the magnitude of x is too large.”

So, it seems that when a function specification says an error occurs or an error may occur, it’s saying when the implementation shall or may report the error - even though the definitions of the kinds of errors are in terms of the mathematical function.

-Jim

On Apr 9, 2014, at 9:51 AM, Ian McIntosh <ianm at ca.ibm.com> wrote:

> It may be hard to detect an exact infinite result when using a non-IEEE floating point implementation.
> 
> - Ian McIntosh          IBM Canada Lab         Compiler Back End Support and Development
> 
> 
> <graycol.gif>Jim Thomas ---2014-04-09 08:31:18 AM---Hmm. The definition says  a pole error (also known as a singularity or infinitary) occurs if the mat
> 
> <ecblank.gif>
> From:
> <ecblank.gif>
> Jim Thomas <jaswthomas at sbcglobal.net>
> <ecblank.gif>
> To:
> <ecblank.gif>
> Rajan Bhakta <rbhakta at us.ibm.com>,
> <ecblank.gif>
> Cc:
> <ecblank.gif>
> cfp-interest at oakapple.net
> <ecblank.gif>
> Date:
> <ecblank.gif>
> 2014-04-09 08:31 AM
> <ecblank.gif>
> Subject:
> <ecblank.gif>
> Re: [Cfp-interest] Pole errors action item result
> <ecblank.gif>
> Sent by:
> <ecblank.gif>
> cfp-interest-bounces at oakapple.net
> 
> 
> 
> Hmm. The definition says
> 
> a pole error (also known as a singularity or infinitary) occurs if the mathematical function has an exact infinite result as the finite input argument(s) are approached in the limit (for example, log(0.0)
> 
> So pole errors occur. I guess what the committee means is the implementation is not required to report them.
> 
> -Jim
> 
> 
> On Apr 9, 2014, at 2:29 AM, Rajan Bhakta <rbhakta at us.ibm.com> wrote:
> With regards to my action item regarding why "may" is used for pole errors: 
> 
> Committee discussion: May is used since pole errors are not required to be present in C11. 
> 
> Regards,
> 
> Rajan Bhakta
> z/OS XL C/C++ Compiler Technical Architect
> ISO C Standards Representative for Canada
> C Compiler Development
> Contact: rbhakta at us.ibm.com, Rajan Bhakta/Houston/IBM_______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest
> 
> 

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


More information about the Cfp-interest mailing list