_. (Indeterminate) Noun/Other

Back to: Vocabulary

Indeterminate (_.) is a numeric atom. It is a placeholder broadly comparable with NaN (not a number). See: http://en.wikipedia.org/wiki/NaN and Essays/Indeterminate.

It can appear in data imported from external sources, eg from a DLL or data base package. For an exhaustive list of sources see the entry in the J Dictionary.

J primitives avoid returning _., even in cases which yield NaN in other languages.

   p=: _ [ q=: __
   p+q
|NaN error
|   p    +q
   p%q
|NaN error
|   p    %q
   0*p,q
0 0
   1%q
0

Common uses

Indeterminate (_.) is not recommended for use in J computations. It may be thought of as representing a "missing value" in statistical data. You should detect it using 128!:5 and replace it with a proper numeric value suited to the computation you want to perform, eg 0, _ or __.

   z
1 2 _. 4
   128!:5 z
0 0 1 0
  0 (I. 128!:5 z) } z
1 2 0 4

It is the only numerical atom that is not equal to itself, from which other bizarre properties arise.

   z=: 1 2 _. 4
   1+z
2 3 _. 5
   z=z
1 1 0 1
   +/z
_.

Numbers (".) can take a left argument: a numeric atom to replace ill-formed numbers. It (and 3!:n) are the only ways to force _. to arise in purely J code. It is not recommended for the purpose: use 0 or _ instead.

   ". '1.23 2.45 3E56 3F56 _1 _0 77'
|ill-formed number
|       ".'1.23 2.45 3E56 3F56 _1 _0 77'
  _. ". '1.23 2.45 3E56 3F56 _1 _0 77'
1.23 2.45 3e56 _. _1 0 77
  0 ". '1.23 2.45 3E56 3F56 _1 _0 77'
1.23 2.45 3e56 0 _1 0 77
  _ ". '1.23 2.45 3E56 3F56 _1 _0 77'
1.23 2.45 3e56 _ _1 0 77

See Also


CategoryVoc

Vocabulary/underdot (last edited 2011-07-01 12:46:32 by IanClark)