System Variable IC: Difference between revisions

From NARS2000
Jump to navigationJump to search
No edit summary
No edit summary
Line 105: Line 105:
<tr>
<tr>
   <td align="center">8</td>
   <td align="center">8</td>
  <td align="center"><apll>∞-∞</apll> (and related)</td>
  <td align="center"><apll>DOMAIN ERROR</apll></td>
</tr>
<tr>
  <td align="center">9</td>
  <td align="center"><apll>L|∞</apll> (either sign infinity)</td>
  <td align="center"><apll>DOMAIN ERROR</apll></td>
</tr>
<tr>
  <td align="center">10</td>
   <td align="center"><apll>0*0</apll></td>
   <td align="center"><apll>0*0</apll></td>
   <td align="center"><apll>1</apll></td>
   <td align="center"><apll>1</apll></td>
Line 110: Line 122:


<tr>
<tr>
   <td align="center">9</td>
   <td align="center">11</td>
   <td align="center"><apll>L*∞</apll> for any <apll>L≤¯1</apll></td>
   <td align="center"><apll>L*∞</apll> for any <apll>L≤¯1</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
Line 116: Line 128:


<tr>
<tr>
   <td align="center">10</td>
   <td align="center">12</td>
   <td align="center"><apll>0⍟0</apll></td>
   <td align="center"><apll>0⍟0</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
Line 122: Line 134:


<tr>
<tr>
   <td align="center">11</td>
   <td align="center">13</td>
   <td align="center"><apll>0⍟1</apll></td>
   <td align="center"><apll>0⍟1</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
Line 128: Line 140:


<tr>
<tr>
   <td align="center">12</td>
   <td align="center">14</td>
   <td align="center"><apll>1⍟0</apll></td>
   <td align="center"><apll>1⍟0</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
   <td align="center"><apll>DOMAIN ERROR</apll></td>
Line 134: Line 146:


<tr>
<tr>
   <td align="center">13</td>
   <td align="center">15</td>
   <td align="center"><apll>1⍟1</apll></td>
   <td align="center"><apll>1⍟1</apll></td>
   <td align="center"><apll>1</apll></td>
   <td align="center"><apll>1</apll></td>
Line 147: Line 159:
   <th valign="top"><apll>⎕IC</apll> Value</th>
   <th valign="top"><apll>⎕IC</apll> Value</th>
   <th valign="top">Result</th>
   <th valign="top">Result</th>
</tr>
<tr>
  <td align="center">¯1</td>
  <td align="center"><apll>¯1</apll></td>
</tr>
</tr>


Line 181: Line 198:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IO←0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IO←0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IC<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IC<br />
3 4 2 2 2 1 2 2 1 2 2 2 2 1<br />
3 4 2 2 2 1 2 2 2 2 1 2 2 2 2 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0÷0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0÷0<br />
1<br />
1<br />
Line 191: Line 208:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IC←⍬<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IC←⍬<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IC<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⎕IC<br />
3 4 2 2 2 1 2 2 1 2 2 2 2 1<br />
3 4 2 2 2 1 2 2 2 2 1 2 2 2 2 1<br />
</apll>
</apll>


==Incomplete List of Indeterminates==
==Incomplete List of Indeterminates==


<p>That there may be other indeterminates not covered by this feature.  Please let us know if you think there are other cases which should be included.</p>
<p>That there may be other indeterminates not covered by this feature.  Please let us know if you think there are other cases that should be included.</p>

Revision as of 02:08, 17 June 2009

Indeterminate Control

Z←⎕IC returns the current value of the Indeterminate Control Vector.
Z is an integer vector whose elements each control a separate aspect of how indeterminates are handled by the system.


⎕IC←R sets all of the values of the Indeterminate Control Vector to R.
⎕IC←⍬ sets all of the values of the Indeterminate Control Vector to their system default state.
⎕IC[L]←R sets the value(s) of the Indeterminate Control Vector indexed by L to R.


This experimental feature attempts to collect together in one place control of various infinite and indeterminate calculations such as ÷0, 0÷0, and friends. The values of this multi-element vector each control a different calculation. In particular,

⎕IC Index
(origin-0)
Indeterminate
Calculation
Default
Result
0 ÷0
1 ⍟0 ¯∞
2 !N for integer N<0 DOMAIN ERROR
3 0×∞ and ∞×0 DOMAIN ERROR
4 0ׯ∞ and ¯∞×0 DOMAIN ERROR
5 0÷0 1
6 ∞÷∞ (same sign) DOMAIN ERROR
7 ∞÷∞ (different sign) DOMAIN ERROR
8 ∞-∞ (and related) DOMAIN ERROR
9 L|∞ (either sign infinity) DOMAIN ERROR
10 0*0 1
11 L*∞ for any L≤¯1 DOMAIN ERROR
12 0⍟0 DOMAIN ERROR
13 0⍟1 DOMAIN ERROR
14 1⍟0 DOMAIN ERROR
15 1⍟1 1

The values in each element of ⎕IC control the result of the calculation as follows:

⎕IC Value Result
¯1 ¯1
0 0
1 1
2 DOMAIN ERROR
3
4 ¯∞

For example,

      ⎕IO←0
      ⎕IC
3 4 2 2 2 1 2 2 2 2 1 2 2 2 2 1
      0÷0
1
      ⎕IC[5]←2
      0÷0
DOMAIN ERROR
      0÷0
       ∧
      ⎕IC←⍬
      ⎕IC
3 4 2 2 2 1 2 2 2 2 1 2 2 2 2 1

Incomplete List of Indeterminates

That there may be other indeterminates not covered by this feature. Please let us know if you think there are other cases that should be included.