>: y (Increment)

Back to: Vocabulary

Returns value one greater than the value of y.

   >: _5 1 0 5
_4 2 1 6

Common uses

You might consider >: 100-z to be slightly less unwieldy than (100-z)+1 or alternatives.

   (>: z i. ' ') { z=. 'ends: (here)'
(
   y=. >:y  NB. increment y

It also helps define neater tacit definitions. Consider these two equivalent explicit definitions of a common mathematical expression:

   13 : '(1+y)%y'
] %~ 1 + ]
   13 : '(>:y)%y'
>: % ]

See Also


x >: y (Larger Or Equal)

Back to: Vocabulary

Returns Boolean (0 or 1) if and only if x>=y is true.

   z=: 7 8 9
   z >: 8
0 1 1

Common uses

Mainly found in the logical conditions of if. statements within verb definitions:

if. x>:y do.  'x y'=. y;x  end.

See Also


CategoryVoc

Vocabulary/gtco (last edited 2011-03-17 14:33:55 by IanClark)