views:

77

answers:

1

Hi, in the J programming language,

-: i. 5

the above function computes the halves of all integers in [0,4]. Now let's say I'd like to re-write the -: function, just for the fun of it. My best guess so far was

]&%.2

but that doesn't seem to cut it. How do you do it?

+2  A: 
%&2    NB. divide by two
0.5&*  NB. multiply by one half
ephemient