Home > Archive > Fortran > September 2005 > Re: What about NANs
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: What about NANs
|
|
| Jugoslav Dujic 2005-09-21, 7:57 am |
| Glyn Edwards wrote:
| This is off topic but is along the same lines of "Why ... in Fortran?".
| Can anyone give me a reason why it is a good idea for programs to carry on
| after hitting producing a Nan? I ask because of the number of times I've
| seen programs produce a Nan and then happily consume CPU resources adding
| to it, multiplying by it etc and producing more Nans.
|
| Is there ever a case when the Nan isn't a bug and if not wouldn't a better
| default behavior be to crash at that point? I realise that compilers can
| catch the nan with certain options but even in optimised code would it not
| be better to crash rather than carry on using CPU cycles producing rubbish?
For example, our software carries on after producing a NaN for several
reasons:
1) it is a part of a larger system which MUSTN'T (well, shouldn't) crash.
2) partly for reason 1) if it gets screwed up, NaNs on output are more
acceptable than a crash (you lose part of information but user can
carry on working). It would be silly that a FPE in a less-important
module brings the whole system down (and yes, the restart takes time)
3) frequently, due to nature of the problems we deal with (power electrics),
NaNs and Infs got zeroed out, i.e. they occur on elements which won't
got outputted anyway (e.g. zero-impedance branches) so they can occur
only as a byproduct.
--
Jugoslav
___________
www.xeffort.com
Please reply to the newsgroup.
You can find my real e-mail on my home page above.
| |
| Michel OLAGNON 2005-09-21, 6:59 pm |
|
Jugoslav Dujic wrote:
>
> For example, our software carries on after producing a NaN for several
> reasons:
>
> 1) it is a part of a larger system which MUSTN'T (well, shouldn't) crash.
The famous Ariane V crash was due to an exception in a part of the launch
software that was a remnant of Ariane IV and whose results were not used
at all, nor sensible indeed, for Ariane V...
|
|
|
|
|