These differences can be summed up by saying "J's index origin is zero".

In particular, since I.y is defined as y#i.#y or (# i.@#)y, the differences in 
the phrases you compare boil down to 
     (i.N)#~ ...
vs
     (1+i.N)#~ ...

That is, the "subtle differences" are all specifically attributable to your 
decision to change from J's default index origin zero to index origin one (ie. 
all differences are due to that one little 1+...).

Which origin is appropriate depends on the application, of course, and it is up 
to the user (J programmer) to choose.



> On Apr 9, 2014, at 11:56 PM, "Linda Alvord" <[email protected]> wrote:
> 
> Some subtle differences.
> 
>    I.+./0=3 5 |/i.35
> 0 3 5 6 9 10 12 15 18 20 21 24 25 27 30 33
> 
>   (1+i.35)#~+./0=3 5 |/1+i.35
> 3 5 6 9 10 12 15 18 20 21 24 25 27 30 33 35
> 
>   +/I.+./0=3 5 |/i.35
> 258
> 
>   +/(1+i.35)#~+./0=3 5 |/1+ i.35
> 293
> 
>   +/I.+./0=3 5 |/ i.1000000x
> 2.33333e11
> 
>   +/(1+i.1000000x)#~+./0x=3 5 |/1 + i.1000000x
> 233334166668
> 
> Linda
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Don Kelly
> Sent: Wednesday, April 09, 2014 7:00 PM
> To: [email protected]
> Subject: Re: [Jprogramming] Euler Project Problem 1
> 
> Nice! I missed the summation part but overall this is much better.
> 
> Don Kelly
>> On 09/04/2014 5:06 AM, Nimp O wrote:
>> +./0=3 5 |/ i.1e3
> 
> ----------------------------------------------------------------------
> 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

Reply via email to