[Jprogramming] under itemize
km
km at math.uh.edu
Fri Oct 11 13:08:18 UTC 2013
Here's a clumsy one that works.
f =: %`0:@.(0=])"0
f i. 2 5
0 1 0.5 0.333333 0.25
0.2 0.166667 0.142857 0.125 0.111111
f 0
0
f 3j4
0.12j_0.16
--Kip Murray
Sent from my iPad
> On Oct 11, 2013, at 6:49 AM, Raul Miller <rauldmiller at gmail.com> wrote:
>
> You did not provide a definition for f.
>
> f=: *%]
>
> gives me this kind of result:
>
> (*%]) i.2 5
> 0 1 0.5 0.333333 0.25
> 0.2 0.166667 0.142857 0.125 0.111111
> (*%]) 0
> 0
> (*%]) 3j4
> 0.2j1.77636e_17
>
> So I'm not sure how you got 0.12j_0.16
>
> Hints?
>
> Thanks,
>
> --
> Raul
>
>
>> On Fri, Oct 11, 2013 at 2:20 AM, Roger Hui <rogerhui.canada at gmail.com> wrote:
>> I find this example unconvincing as the following achieves the same end
>> much more simply and efficiently.
>>
>> f i.2 5
>> 0 1 0.5 0.333333 0.25
>> 0.2 0.166667 0.142857 0.125 0.111111
>> f 0
>> 0
>> f 3j4
>> 0.12j_0.16
>>
>>
>>
>>
>> On Thu, Oct 10, 2013 at 9:48 PM, David Lambert <b49p23tivg at stny.rr.com>wrote:
>>
>>> I don't find examples of "under itemize" in the under essay. I inserted
>>> an entry " Extend verb domain".
>>>
>>>
>>> reciprocal_or_zero =: =&0`(0,:~%)} NB. zeros may come from fill
>>>
>>> reciprocal_or_zero 8 NB. OH NO!
>>> |rank error: reciprocal_or_zero
>>> | reciprocal_or_zero 8
>>>
>>>
>>> (;$) reciprocal_or_zero&.,:8
>>> +-----++
>>> |0.125||
>>> +-----++
>>>
>>> (;$) reciprocal_or_zero&.,:i. 2 5
>>> +-----------------------------**----------+---+
>>> | 0 1 0.5 0.333333 0.25|2 5|
>>> |0.2 0.166667 0.142857 0.125 0.111111| |
>>> +-----------------------------**----------+---+
>>>
>>> ------------------------------**------------------------------**----------
>>> For information about J forums see http://www.jsoftware.com/**forums.htm<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
More information about the Programming
mailing list