On 02/16/2012 01:52 PM, Jordi Gutiérrez Hermoso wrote:
> On 16 February 2012 02:29, Alois Schloegl<alois.schlo...@ist.ac.at>  wrote:
>> If you are tired of these nagging warnings, ask the developers of octave
>> to fix it. And I do not mean turning off the warning on shadowing
>> functions, but to implement the NaN-skipping behavior within the
>> existing core functions.
>
> NaN-skipping behaviour is semantically wrong.


What do you mean by "semantically wrong"?  NaN's are designed to 
indicate an undefined value - a value that has no numerical meaning but 
signals that no value is available - it signals a missing value.


"NaN" doesn't mean
> "missing data". It means "you performed an invalid computation".

... and get an undefined results - a result with no numerical value.
There is no contradiction here.


> When
> you performed an invalid computation, any computation that follows
> from it is also invalid. Numerical nonsense goes in, numerical
> nonsense should come out.
>
> It is of course tempting to use NaN to represent missing data,
> because, really, what other value would you use? But it's in fact an
> abuse of floating point operations.

NaN's are not an abuse of floating point numbers, but NaN's were 
designed for a cause were the value is not defined (something that is 
missing in integers).

In former times, invalid operations were signaled with an interrupt, 
using a separate communication channel. With NaN's it became possible 
that invalid operations are signaled through the same channel. 
(Depending on the point of view, one could call this an abuse of NaN's, 
too).

I do not call this an abuse because, I think the invention of NaN has 
been a great achievement. Unfortunately, some people think of NaN's only 
as simple (and crude) way for exception handling. But NaN's are more 
powerful than that.


If the data type were not floating
> points, but, say, integers, what value would you use to represent
> "missing data"?
>
> I think it's ok to change the meaning of "NaN" for statistical
> convenience, but it's not a solution to use it in this way if you're
> solving a PDE and your step size is wrong and starts producing NaN.

Agreed, but the NaN-toolbox and the functions it shadows, do no solve 
deterministic problems (like PDE's) but purely statistical functions. 
Thus, it is justified to skip NaN's.


Alois



>
> - 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

Reply via email to