[Jprogramming] Adding constants to intervals

Henry Rich henryhrich at gmail.com
Thu Nov 21 00:38:34 UTC 2019


Use (+ i.)&.>

 > on unboxed values is like ]"0

If you are trying to create selectors for an array use ];.0

Henry Rich

On 11/20/2019 7:35 PM, Jimmy Gauvin wrote:
> Hi,
>
> I have intervals of varying length and I want to add a different constant
> to each of them.
>
> Is there a better way than the following to achieve this :
>
>     (<"0 , 10 20 30) +&.> <@i."0 (3 2 4)
> ┌────────┬─────┬───────────┐
> │10 11 12│20 21│30 31 32 33│
> └────────┴─────┴───────────┘
>
>
> Thanks
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



More information about the Programming mailing list