An adjustment of Bo's idea works on my iPad.  We want to replace a real or 
imaginary part that is < 2^_44 by 0 .

    clean =: (_256 + 256 + ])&.+.  NB. Bo's idea adjusted
    
    (2^_44) > ee =: 2 ^ _44 - i. 4
 0 1 1 1
    
    clean ee  
 5.684341886080801487e_14 0 0 0
    
    ]aa =: 2 2 $ ee j. i. 4
    5.684341886080801487e_14 2.8421709430404007435e_14j1
 1.4210854715202003717e_14j2 7.1054273576010018587e_15j3
    
    clean aa
 5.684341886080801487e_14 0j1
                      0j2 0j3

--Kip

Sent from my iPad

> On Nov 8, 2013, at 5:59 PM, Bo Jacoby <[email protected]> wrote:
> 
>    ]dd =: ^ 0j1 * o. i. 2 2
>    (_10+10+])&.:j.dd
> 1 _1
> 1 _1
> 
> 
> 
> 
> 
> 
> Den 20:15 fredag den 8. november 2013 skrev km <[email protected]>:
> 
> That was quick!  --Kip
>> 
>> Sent from my iPad
>> 
>>> On Nov 8, 2013, at 1:04 PM, Henry Rich <[email protected]> wrote:
>>> 
>>>    clean =. (* (2^_44) < |)&.:+.
>>>    clean =. (* *@:|)&.:+.
>>> 
>>> Henry Rich
>>> 
>>>> On 11/8/2013 1:36 PM, km wrote:
>>>> If the absolute value of a real or imaginary part is < 2_44 then verb 
>>>> clean replaces the part by 0.
>>>> 
>>>> Write verb clean.
>>>> 
>>>>      ]dd =: ^ 0j1 * o. i. 2 2
>>>>                1 _1j1.22465e_16
>>>>   1j_2.44929e_16 _1j3.67394e_16
>>>> 
>>>>      clean dd
>>>>   1 _1
>>>>   1 _1
>>>> 
>>>>      0j1 * dd
>>>>             0j1 _1.22465e_16j_1
>>>>   2.44929e_16j1 _3.67394e_16j_1
>>>> 
>>>>      clean 0j1 * dd
>>>>   0j1 0j_1
>>>>   0j1 0j_1
>>>> 
>>>>      +. dd
>>>>    1            0
>>>>   _1  1.22465e_16
>>>> 
>>>>    1 _2.44929e_16
>>>>   _1  3.67394e_16
>>>> 
>>>>      clean +. dd
>>>>    1 0
>>>>   _1 0
>>>> 
>>>>    1 0
>>>>   _1 0
>>>> 
>>>> --Kip Murray
>>>> 
>>>> Sent from my iPad
>>>> 
>>>> ----------------------------------------------------------------------
>>>> 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
>> 
>> 
>> 
> ----------------------------------------------------------------------
> 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