Index   <<   >>

No end in sight

_

J is one of the few programming languages that deals with infinite values and results.

There are mathematical functions that properly yield infinity for certain arguments. For example, the reciprocal of 0, and the identity element for minimum. The ASCII underline is used to denote infinity: _

On a J system, entering the expression %0 yields the result _ , as does the expression <./'' ; furthermore, infinity may be entered as a constant (by typing _ ) and may be used in numeric constants, where it obeys the algebra specified by IEEE standard 754. See the power table below for 0^y and x^0 . The utility verbs by and over are defined on Lay it on the table.

   ]v=.-:_3+i.7
_1.5 _1 _0.5 0 0.5 1 1.5

   (|. by ] over (|.^/])) v
┌────┬──────────────────────────────────────────────────────────────┐
│    │      _1.5        _1        _0.5 0        0.5    1         1.5│
├────┼──────────────────────────────────────────────────────────────┤
│ 1.5│  0.544331  0.666667    0.816497 1    1.22474  1.5     1.83712│
│   1│         1         1           1 1          1    1           1│
│ 0.5│   2.82843         2     1.41421 1   0.707107  0.5    0.353553│
│   0│         _         _           _ 1          0    0           0│
│_0.5│ 0j2.82843        _2  0j_1.41421 1 0j0.707107 _0.5 0j_0.353553│
│  _1│       0j1        _1        0j_1 1        0j1   _1        0j_1│
│_1.5│0j0.544331 _0.666667 0j_0.816497 1  0j1.22474 _1.5  0j_1.83712│
└────┴──────────────────────────────────────────────────────────────┘