Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: How to chec...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 35 Topic 5676 of 5828
Post > Topic >>

Re: How to check a Float for NaN

by "Stuart" <stuart@[EMAIL PROTECTED] > May 1, 2008 at 06:14 PM

"Adam Beneschan" <adam@[EMAIL PROTECTED]
> wrote in message 
news:fe6a8cc1-eac7-4b25-bd21-39f9c2015c4a@[EMAIL PROTECTED]
> On May 1, 1:04 am, "Stuart" <stu...@[EMAIL PROTECTED]
> wrote:
>> "Adam Beneschan" <a...@[EMAIL PROTECTED]
> wrote in message
>
>> > 13.9.2(4-11) lists the ways
>> > that invalid data could be created, and the "result of a floating-
>> > point operation that cannot return a valid result" is not one of
those
>> > listed.  Yes, I know that this is a NOTE and is not normative.)
>>
>> Would not 13.9.2(10) cover this:
>>    "disrupting an assignment due to the failure of a language-defined 
>> check
>> (see 11.6)"
>
> Did you read 11.6?

I tried, but legalese is not my first language and I find some of the 
'language lawyerly' stuff rather impenetrable at times. ;-)

> I think all this says is that if an assignment statement raises an
> exception (due to a language-defined check), then in the exception
> handler and further on in the code, you can't count on the value of
> the target object being normal.  You can't count on it being abnormal,
> either.  But if no exception is raised, then this doesn't apply.

I agree with what you are saying here; which I read as 'you can't count on

the target object being obviously invalid (e.g. a NaN), but it _could_
be'. 
As such 13.9.2(10) appears to sup****t a case by which a NaN value could 
arise in an object during computation.

In a nominal Ada program it would be sensible to deal with the situation
in 
the exception handler, rather than let it slide and try and resolve it
later 
using 'valid.  But then, I think, we are picking-over the innards of some 
murky corner case of the language - so good-sense need not apply ;-)

I would hazard a guess that we have strayed well away from the OP's
original 
area of interest (he was probably validating inputs), and as you noted 
earlier.

Regards
-- 
Stuart
 




 35 Posts in Topic:
How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-04-30 03:27:51 
Re: How to check a Float for NaN
christoph.grein@[EMAIL PR  2008-04-30 03:47:54 
Re: How to check a Float for NaN
christoph.grein@[EMAIL PR  2008-04-30 03:50:15 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-04-30 08:02:05 
Re: How to check a Float for NaN
"Randy Brukardt"  2008-04-30 18:29:14 
Re: How to check a Float for NaN
"Stuart" <st  2008-05-01 09:04:11 
Re: How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-04-30 13:33:17 
Re: How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-04-30 13:36:21 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-04-30 14:53:54 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-04-30 16:23:13 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-04-30 18:00:21 
Re: How to check a Float for NaN
Keith Thompson <kst-u@  2008-05-01 12:52:16 
Re: How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-04-30 18:05:41 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-05-01 07:38:40 
Re: How to check a Float for NaN
"Stuart" <st  2008-05-01 18:14:09 
Re: How to check a Float for NaN
"Randy Brukardt"  2008-05-01 14:22:35 
Re: How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-05-01 16:57:26 
Re: How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-05-01 17:04:53 
Re: How to check a Float for NaN
Martin Krischik <krisc  2008-05-05 20:23:02 
Re: How to check a Float for NaN
anon@[EMAIL PROTECTED] (  2008-05-10 17:00:51 
Re: How to check a Float for NaN
Keith Thompson <kst-u@  2008-05-11 15:00:55 
Re: How to check a Float for NaN
anon@[EMAIL PROTECTED] (  2008-05-12 02:01:18 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-05-05 13:49:25 
Re: How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-05-06 11:09:56 
Re: How to check a Float for NaN
"Wiljan Derks"   2008-05-06 20:45:47 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-05-06 15:18:39 
Re: How to check a Float for NaN
"Randy Brukardt"  2008-05-07 17:56:57 
Re: How to check a Float for NaN
Stephen Leake <Stephe.  2008-05-09 03:24:21 
Re: How to check a Float for NaN
"Randy Brukardt"  2008-05-07 17:56:57 
Re: How to check a Float for NaN
Adam Beneschan <adam@[  2008-05-07 16:20:55 
Re: How to check a Float for NaN
anon@[EMAIL PROTECTED] (  2008-05-09 19:49:50 
Re: How to check a Float for NaN
Jerry <lanceboyle@[EMA  2008-05-09 19:36:58 
Re: How to check a Float for NaN
anon@[EMAIL PROTECTED] (  2008-05-10 03:53:54 
Re: How to check a Float for NaN
Georg Bauhaus <see.rep  2008-05-10 10:05:33 
Re: How to check a Float for NaN
christoph.grein@[EMAIL PR  2008-05-09 23:24:48 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 14:48:13 CDT 2008.