Re: [Jprogramming] (,a,.2),.,a,.3

2018-03-10 Thread Raul Miller
Looks like you could use another stage to clean up results? 1 {:: p. 1 2 1 _1 _1 p5 1 2 1 _1j1.54593e_9 _1j3.48012e_9 P.S. looking at the source, J is using Laguerre's method (so I'd use p.. if I were re-implementing it in J). Thanks, -- Raul On Sat, Mar 10, 2018 at 2:13 AM, 'Bo Jacob

Re: [Jprogramming] (,a,.2),.,a,.3

2018-03-10 Thread 'Bo Jacoby' via Programming
Yes Raul. I do not at all claim that (p5) is better that (p.). Perhaps J should always display the same number of decimals for the real part and the imaginary part of a complex number, such that the result would read _1.0j0.0 _1.0j0.0 (%:i.2) is (0 1) , and (%:i.3) is (0 1 1.41421

Re: [Jprogramming] (,a,.2),.,a,.3

2018-03-10 Thread Raul Miller
I see what you mean. But, as stated, this would bulk up the display unnecessarily. You could probably add a rule for trimming zero digits, which might make this palatable, but that would be something different. -- Raul On Sat, Mar 10, 2018 at 9:56 AM, 'Bo Jacoby' via Programming wrote: > Yes

Re: [Jprogramming] (,a,.2),.,a,.3

2018-03-10 Thread 'Bo Jacoby' via Programming
Is there a standard verb for displaying arrays my way?---Bo. Den 15:57 lørdag den 10. marts 2018 skrev 'Bo Jacoby' via Programming : Yes Raul. I do not at all claim that (p5) is better that (p.). Perhaps J should always display the same number of decimals for the real part and the imagi

Re: [Jprogramming] (,a,.2),.,a,.3

2018-03-10 Thread Raul Miller
I think you would need to write it before anyone could consider it for standardization. -- Raul On Sat, Mar 10, 2018 at 10:15 AM, 'Bo Jacoby' via Programming wrote: > Is there a standard verb for displaying arrays my way?---Bo. > > Den 15:57 lørdag den 10. marts 2018 skrev 'Bo Jacoby' via P

Re: [Jprogramming] (,a,.2),.,a,.3

2018-03-10 Thread 'Bo Jacoby' via Programming
Something like this: p5 0 1 2 3 4 5 0 NB. tiny imaginary part 0j_4.94066e_324 0.137832j_0.678154 _0.537832j0.358285 0.137832j0.678154 _0.537832j_0.358285 round=.(1e9*1j1*+/@:|)+]-1e9*1j1*+/@:| round p5 0 1 2 3 4 5 0 NB. zero imaginary part 0 0.137832j_0.678154 _0.537832j0.358284 0.137832j0.67815