System Variable IC: Difference between revisions
No edit summary |
|||
Line 75: | Line 75: | ||
<tr> | <tr> | ||
<td align="center">3</td> | <td align="center">3</td> | ||
<td align="center"><apll>0×∞</apll> | <td align="center"><apll>0×∞</apll> or <apll>∞×0</apll></td> | ||
<td align="center"><apll>DOMAIN ERROR</apll></td> | <td align="center"><apll>DOMAIN ERROR</apll></td> | ||
</tr> | </tr> | ||
Line 81: | Line 81: | ||
<tr> | <tr> | ||
<td align="center">4</td> | <td align="center">4</td> | ||
<td align="center"><apll>0ׯ∞</apll> | <td align="center"><apll>0ׯ∞</apll> or <apll>¯∞×0</apll></td> | ||
<td align="center"><apll>DOMAIN ERROR</apll></td> | <td align="center"><apll>DOMAIN ERROR</apll></td> | ||
</tr> | </tr> | ||
Line 105: | Line 105: | ||
<tr> | <tr> | ||
<td align="center">8</td> | <td align="center">8</td> | ||
<td align="center"><apll>∞-∞</apll> ( | <td align="center"><apll>∞-∞</apll> (same sign)</td> | ||
<td align="center"><apll>DOMAIN ERROR</apll></td> | <td align="center"><apll>DOMAIN ERROR</apll></td> | ||
</tr> | </tr> | ||
Line 111: | Line 111: | ||
<tr> | <tr> | ||
<td align="center">9</td> | <td align="center">9</td> | ||
<td align="center"><apll>L| | <td align="center"><apll>L|±∞</apll></td> | ||
<td align="center"><apll>DOMAIN ERROR</apll></td> | <td align="center"><apll>DOMAIN ERROR</apll></td> | ||
</tr> | </tr> | ||
Line 149: | Line 149: | ||
<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> | ||
</tr> | |||
<tr> | |||
<td align="center">16</td> | |||
<td align="center"><apll>0*∞</apll></td> | |||
<td align="center"><apll>0</apll></td> | |||
</tr> | |||
<tr> | |||
<td align="center">17</td> | |||
<td align="center"><apll>0*¯∞</apll></td> | |||
<td align="center"><apll>∞</apll></td> | |||
</tr> | |||
<tr> | |||
<td align="center">18</td> | |||
<td align="center"><apll>±∞*0</apll></td> | |||
<td align="center"><apll>DOMAIN ERROR</apll></td> | |||
</tr> | |||
<tr> | |||
<td align="center">19</td> | |||
<td align="center"><apll>0∨±∞</apll> or <apll>±∞∨0</apll></td> | |||
<td align="center"><apll>DOMAIN ERROR</apll></td> | |||
</tr> | |||
<tr> | |||
<td align="center">20</td> | |||
<td align="center"><apll>0∧±∞</apll> or <apll>±∞∧0</apll></td> | |||
<td align="center"><apll>DOMAIN ERROR</apll></td> | |||
</tr> | </tr> | ||
Line 198: | Line 228: | ||
⎕IO←0<br /> | ⎕IO←0<br /> | ||
⎕IC<br /> | ⎕IC<br /> | ||
3 4 2 2 2 1 2 2 2 2 1 2 2 2 2 | 3 4 2 2 2 1 2 2 2 2 1 2 1 2 2 1 0 3 2 2 2<br /> | ||
0÷0<br /> | 0÷0<br /> | ||
1<br /> | 1<br /> | ||
Line 208: | Line 238: | ||
⎕IC←⍬<br /> | ⎕IC←⍬<br /> | ||
⎕IC<br /> | ⎕IC<br /> | ||
3 4 2 2 2 1 2 2 2 2 1 2 2 2 2 | 3 4 2 2 2 1 2 2 2 2 1 2 1 2 2 1 0 3 2 2 2<br /> | ||
</apll> | </apll> | ||
To set all indeterminate results to <apll>DOMAIN ERROR</apll>, use <apll>⎕IC[]←2</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 that 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 19:55, 18 May 2011
Indeterminate Control
|
||||
Z is an integer vector whose elements each control a separate aspect of how indeterminates are handled by the system. |
|
This experimental feature attempts to collect together in one place control of various infinite and indeterminate calculations such as ÷0,
⎕IC Index (origin-0) |
Indeterminate Calculation |
Default Result |
---|---|---|
0 | ÷0 | ∞ |
1 | ⍟0 | ¯∞ |
2 | !N for integer N<0 | DOMAIN ERROR |
3 | 0×∞ or ∞×0 | DOMAIN ERROR |
4 | 0ׯ∞ or ¯∞×0 | DOMAIN ERROR |
5 | 0÷0 | 1 |
6 | ∞÷∞ (same sign) | DOMAIN ERROR |
7 | ∞÷∞ (different sign) | DOMAIN ERROR |
8 | ∞-∞ (same sign) | DOMAIN ERROR |
9 | L|±∞ | 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 |
16 | 0*∞ | 0 |
17 | 0*¯∞ | ∞ |
18 | ±∞*0 | DOMAIN ERROR |
19 | 0∨±∞ or ±∞∨0 | DOMAIN ERROR |
20 | 0∧±∞ or ±∞∧0 | DOMAIN ERROR |
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 1 2 2 1 0 3 2 2 2
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 1 2 2 1 0 3 2 2 2
To set all indeterminate results to DOMAIN ERROR, use ⎕IC[]←2.
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.