RANK ERROR: Difference between revisions
Jump to navigation
Jump to search
m (Errors category) |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
Line 5: | Line 5: | ||
⍳2 3⍴⍳6 | ⍳2 3⍴⍳6 | ||
∧ | ∧ | ||
</ | </syntaxhighlight> | ||
A RANK ERROR can be caused when arguments do not [[Conformability|conform]] because they have differing ranks: | A RANK ERROR can be caused when arguments do not [[Conformability|conform]] because they have differing ranks: | ||
Line 13: | Line 13: | ||
(2 3⍴2)+⍳6 | (2 3⍴2)+⍳6 | ||
∧ | ∧ | ||
</ | </syntaxhighlight> | ||
It may also be caused when an array's rank is too small for a function. [[Windowed Reduction]] is not defined on scalars: | It may also be caused when an array's rank is too small for a function. [[Windowed Reduction]] is not defined on scalars: | ||
Line 21: | Line 21: | ||
2+/0.5 | 2+/0.5 | ||
∧ | ∧ | ||
</ | </syntaxhighlight> | ||
A RANK ERROR may be caused when argument ranks are incompatible in some other way. In languages with [[high-rank set functions]] such as [[Dyalog APL]] and [[J]], the right argument rank must be at least the left argument rank minus one. Calling it with a matrix left argument and a scalar right argument, which has a rank two smaller, gives a RANK ERROR: | A RANK ERROR may be caused when argument ranks are incompatible in some other way. In languages with [[high-rank set functions]] such as [[Dyalog APL]] and [[J]], the right argument rank must be at least the left argument rank minus one. Calling it with a matrix left argument and a scalar right argument, which has a rank two smaller, gives a RANK ERROR: | ||
Line 29: | Line 29: | ||
(⍳3 4)⍳⊂1 3 | (⍳3 4)⍳⊂1 3 | ||
∧ | ∧ | ||
</ | </syntaxhighlight> | ||
{{Works in|[[Dyalog APL]]}} | {{Works in|[[Dyalog APL]]}} | ||
{{APL features}}[[Category:Errors]] | {{APL features}}[[Category:Errors]] |