<: y (Decrement)

Back to: Vocabulary

Returns value one less than the value of y.

   <: _5 1 0 5
_6 0 _1 4

Common uses

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

   (<: z i. ' ') { z=. 'ends: (here)'
:
   y=. <:y  NB. decrement y

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

   13 : '(y-1)%y'
] %~ 1 -~ ]
   13 : '(<:y)%y'
<: % ]

See Also


x <: y (Less Or Equal)

Back to: Vocabulary

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

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

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/ltco (last edited 2011-03-17 14:18:55 by IanClark)