comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: !null values in arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: !null values in arrays [message #74040] Thu, 16 December 2010 07:39 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Dec 16, 1:14 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
> Purely for perspective into the issue, ruby handles operations with null values thusly:
>
> irb(main):001:0> 3 + nil
> TypeError: nil can't be coerced into Fixnum
>         from (irb):1:in `+'
>         from (irb):1
>
> and python similarly:
>
>>>> 3 + None
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

Both appropriate. !null and NaN are not the same, and are not the same
as 0. In fact, their lack in more primitive languages is an important
hassle.

0 is not, intrinsically, the same as missing data. In particular, most
mathematical operations on NaNs (say, adding a value to a NaN) should
always return NaN to make sense. If an array has missing data, data
cannot be magically created on the missing elements because, say, a
scalar was added to the array.

NaN is special in the sense that it is a floating point value, part of
the IEEE 754 standard, and properly recognized by hardware and other
software. !null is a language construct, which necessarily varies
among languages, as they vary in what constitutes a variable. It is an
undefined variable, so one can assign to it, but not operate on it,
the same way that one cannot operate on an undefined variable, but can
create it by assignment.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Viewing and Printing PostScript Files
Next Topic: ITT VIS at the 2010 AGU Fall Meeting

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:39:14 PDT 2025

Total time taken to generate the page: 0.00432 seconds