2012/2/17 Alois Schloegl <alois.schlo...@ist.ac.at>: > On 02/17/2012 03:01 PM, Jordi Gutiérrez Hermoso wrote: >>
>> I went to read the IEEE 754 standard, and you're right, they do >> explicitly say in section 6.2 >> >> Quiet NaNs should, by means left to the implementer’s discretion, >> afford retrospective diagnostic information inherited from invalid >> or unavailable data and results. >> >> so it's also meant for missing values. Huh, I was wrong. However, they >> also go on to say, >> >> For an operation with quiet NaN inputs, other than maximum and >> minimum operations, if a floating-point result is to be delivered >> the result shall be a quiet NaN which should be one of the input >> NaNs. >> >> so the NaN toolbox is in fact breaking the IEEE 754 standard, since it >> does not return NaN for many operations that it should. > > > > The IEEE754 standard defines on unary and binary operations like > +,-,*,/, <,>,<=,>=,==,<>,!; it does not talk about statistical > functions. Where are you seeing this? Section 5 seems to be defining operations, and the passage I quoted above specifically thinks it's necessary to refer to "maximum" and "minimum" as operations. I don't see the standard referring to only binary operations. The way I read section 5.1, an operation is anything that produces floating-point results. Including sum(), mean(), and std(). >> Not that not following a standard is wrong. Sometimes standards are >> meant to be broken. ;-) But I don't think they should be broken by >> default, so please don't ask us, the developers of Octave, to break >> it. >> >> This has been illuminating, though, and it gives a clear indication >> of how to fix this: >> >> https://savannah.gnu.org/bugs/?32885 >> >> According to IEEE 754, NaN-skipping behaviour should happen here. > > > > So, you agree that NaN-skipping behavior is sometimes ok ? So what > is your concern with the NaN-toolbox? I agee it's ok when you explicitly *don't* want IEEE-754-conforming behaviour. However, in the case of the bug above, IEEE-754-conforming behaviour is to skip NaNs, as dictated in section 6.2 for max() and min(), but the standard is quite clear that these are the *only* operations that should skip NaNs. - Jordi G. H. ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev