home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / sci / math / 17329 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  3.3 KB

  1. Path: sparky!uunet!psinntp!kepler1!andrew
  2. From: andrew@rentec.com (Andrew Mullhaupt)
  3. Newsgroups: sci.math
  4. Subject: Re: Not-a-Number
  5. Message-ID: <1428@kepler1.rentec.com>
  6. Date: 22 Dec 92 16:14:05 GMT
  7. References: <7ZJ0uB1w165w@west.darkside.com> <BzGwEC.ALr@unx.sas.com>
  8. Organization: Renaissance Technologies Corp., Setauket, NY.
  9. Lines: 58
  10.  
  11. In article <BzGwEC.ALr@unx.sas.com> sasbmt@jjoyce.unx.sas.com (Bruce Tindall) writes:
  12. >
  13. >In article <7ZJ0uB1w165w@west.darkside.com>, susskind@west.darkside.com (Mark Susskind) writes:
  14. >>On to the main purpose.  I believe that it would be pointless to assign
  15. >>Not-a-Number to a variable because one cannot really do any algebra with
  16. >>it.  For a quick example, let x=NaN.  What would be x+1?  What about 2x?
  17. >>And 0x would be every real (or complex) number, would it not?
  18.  
  19. Actually, there are _conceivable_ uses of NaN assignment, mostly for
  20. testing things. According to IEEE specs, NaN+1 is NaN, 2*NaN is NaN and
  21. so is 0*NaN. The rules for NaN are basically that it represents something
  22. which is _not be a number_, and by implication, any arithmetical operations
  23. applied to it result in similar _not numbers_. Comparison expressions, such
  24. as x > y are _unordered_ if either x or y are NaN, even in the case x = y
  25. where x and y may both be NaN. There is a very good set of rules for these
  26. worked out in the specification for the standard IEEE arithmetic.
  27.  
  28. >Certain software systems, such as the SAS system, recognize several
  29. >different "not a number" values (which SAS calls "missing values").  
  30. >Usually, any arithmetic operation on a missing value yields a missing 
  31. >value.  There are some circumstances in which missing values are 
  32. >treated as zero instead. 
  33.  
  34. Which in particular shows that the sensible treatment of missing values
  35. is different than the sensible treatment of non-numbers.
  36.  
  37. > In sorting and comparisons, missing values 
  38. >sort as less than the "most negative" number (i.e., less than the 
  39. >negative number with the greatest absolute value).
  40.  
  41. This is also different than not a number.
  42.  
  43. >These properties, and the ability to select between them, are useful 
  44. >in applications such as survey research (in which you may want to
  45. >distinguish among different kinds of missing data, such as "respondent
  46. >not home," "refused to answer," "didn't know," "not applicable," etc.)
  47. >and statistical analysis.  
  48.  
  49. Yes, a lot of people think of NaN in this way, and it may be convenient
  50. for implementers to use NaN to support these. However, NaN and missing
  51. values have different semantics, are different things, and ultimately
  52. it pays not to confuse them. Missing values are essentially _unspecified
  53. numbers_ or _numbers to be named later_, and it is acceptable to treat
  54. these values as having those properties common to all numbers. NaN, on
  55. the other hand, does not have these properties. In particular it makes
  56. sense for NaN to be the result of 0.0 / 0.0, but it does not make sense
  57. for this ratio to be thought of as a number which will be subsequently
  58. determined, since contradictions can result from assuming that 0.0 / 0.0
  59. has the properties of a number.
  60.  
  61. It would be nice to have a standard arithmetic which dealt with unspecified
  62. values, but none exists to my knowledge.
  63.  
  64. An interesting approach which can support this is interval arithmetic,
  65. which can represent unspecified numbers as maximum ranges.
  66.  
  67. Later,
  68. Andrew Mullhaupt
  69.