Oops, for some reason I thought you wanted even and odd digits. To get
first and last, you can use
a=.10 #.^:_1 <[email protected]^199
'first last' =. (<.-:#a) ({. ; }.) a
first
3 1 4 1 5 ...
last
9 8 2 1 4 ...
On 3/25/2012 10:29 AM, Henry Rich wrote:
> a=.<[email protected]^199
> 'evendig odddig' =. |: _2 [\ 10 #.^:_1 a
> evendig
> 3 4 5 2 5 ...
> odddig
> 1 1 9 6 3 ...
>
> Henry Rich
>
> On 3/25/2012 6:19 AM, m l wrote:
>>
>> The verb<[email protected]^n generates the n digits of Pi.
>>
>> Now, asign this to a variable, for example, a=.<[email protected]^200 (n=200 in this
>> case)
>>
>> How to extract the n/2 first digts and asign to another variable ?
>>
>> How to extract the n/2 last digits and asign to a variable ?
>>
>> Thanks.
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm