> How powerful is J's ^:_1 operator?
Very.

> How is it implemented?
Carefully. ☺  It's a giant table look-up.  Some of the inverses were
put in to impress particular people, lying in wait for years.  (It
worked!  Worth all the effort and all the waiting because of who it
was.)

See http://www.jsoftware.com/jwiki/Essays/Under , the raison d'être
for having inverses.



On Wed, Nov 2, 2011 at 11:14 AM, Andrew Pennebaker
<[email protected]> wrote:
> Fascinating.
>
> How powerful is J's ^:_1 operator? How is it implemented?
>
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
>
> On Wed, Nov 2, 2011 at 10:02 AM, Roger Hui <[email protected]>wrote:
>
>> It's better to define functions in the form "F from G" rather than "G
>> to F", because then the argument and result would be adjacent to the
>> function whose domain/range they are in:
>>
>> f =: FfG g
>> f =: GtF g
>>
>>
>>
>> On Wed, Nov 2, 2011 at 1:32 AM, Alan Stebbens <[email protected]> wrote:
>> >> How would one parse a hex string back to an integer?
>> >
>> > Two ways:
>> >
>> > Hard way:
>> >
>> >   H2D =: [: +/ 16 1 * '0123456789abcdef' I. ]
>> >   H2D 'A0'
>> > 160
>> >
>> > Easy way:
>> >
>> >   h2d =: d2h ^:_1
>> >   h2d 'a0'
>> > 160
>> >  h2d d2h i.20
>> > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
>> >
>> >
>> > ----------------------------------------------------------------------
>> > 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