Thank you.

Just another small question.


For what reason other than speed does (x A. y) use anything other than
extended for the 'x' input? Other than integer, doesn't everything else
lead to inconsistent outputs (i.e. an incorrect  permutation selection)?

I am not sure of the different ways people use this operator but maybe some
other examples might help me understand more clearly.

Thank you all again.

Ak




On Fri., Aug. 11, 2023, 21:05 'Pascal Jasmin' via Programming, <
programm...@jsoftware.com> wrote:

>  if you (or a user) are calling your function from J code, add the x to
> any "literal numbers".
> If your very large number is the result of a calculation, then you can
> ensure that it is returned as extended.
> If the input comes from elsewhere/other program, then pass it as a string.
>
> ".@,&'x' '1239810239812039812039812039180319283019283'
>
> 1239810239812039812039812039180319283019283
>
>
>     On Friday, August 11, 2023 at 08:29:47 p.m. EDT, Ak O <
> akin...@gmail.com> wrote:
>
>  For me,
> (x: y)
> does not preserve the input.
>
> The result I get is not the same.
>
>
>           ( x:180548043269214561950911457875657 )
>  180548043269214573494164592263168
> This does not work.
>
>
>
>           180548043269214561950911457875657x
> 180548043269214561950911457875657
> This does work.
>
>
>
>
>
> On Fri., Aug. 11, 2023, 13:01 Henry Rich, <henryhr...@gmail.com> wrote:
>
> > (x: value) produces extended version of value.
> >
> > Henry Rich
> >
> > On Fri, Aug 11, 2023, 2:44 PM Ak O <akin...@gmail.com> wrote:
> >
> > > Hi everybody, I hope you are all well.
> > >
> > > I have a question about the Anagram ( A. ) operator.
> > >
> > > In a defined function, how do I designate that an input 'x' is
> treatment
> > > as  extended datatype rather than float?
> > >
> > > Where being defined:
> > >      13 : ' x A. i.y'
> > > [ A. [: i. ]
> > >
> > >  is to be taken as,
> > >      13 : 'X_INPUTx A. y'    NB. 12345672345467x A. i.y
> > >
> > > How do I get the affect of catenating an 'x' to the end of a number in
> a
> > > defined function?
> > >
> > > If you understand my question ignore below, otherwise I give an
> example.
> > >
> > > Thank you for your thoughts.
> > >
> > > Ak
> > >
> > >
> > > My understanding of the Anagram operator (A.).
> > > The vocabulary reference page (acapdot) gives the product of the
> Anagram
> > > index function
> > >    A. y
> > > as datatype extended.
> > >
> > >
> > > The Anagram function
> > >    x A. y
> > > applies the permutation map (x) on  ordered vector sequence (y) as
> below.
> > >
> > >
> > > ]    vector_sequence =:      ?~30
> > > 20 12 4 29 7 17 22 11 2 27 28 23 6 21 9 3 24 10 26 13 15 1 18 8 25 19
> 0 5
> > > 16 14
> > >
> > >
> > > ]    vector_anagram =:    A. vector_sequence
> > > 180548043269214561950911457875657
> > >
> > > The Noun, vector_anagram will have datatype extended, given by:
> > >    datatype vector_anagram
> > > extended
> > >
> > > Applying the vector_anagram on a vector using the command:
> > >      vector_anagram A. i.30
> > > 20 12 4 29 7 17 22 11 2 27 28 23 6 21 9 3 24 10 26 13 15 1 18 8 25 19
> 0 5
> > > 16 14
> > >
> > > The expected result.
> > >
> > > In a case where the digits are input on there own, the following fails
> > with
> > > 'domain error, executing dyad A.'
> > >
> > >      180548043269214561950911457875657 A. i.30
> > >
> > > One approach is to place 'x:' before the input.
> > >      ( x:180548043269214561950911457875657 )A. i.30
> > > 20 12 4 29 7 17 22 11 2 27 28 25 1 8 0 15 16 14 3 5 19 26 18 6 21 23 13
> > 24
> > > 9 10
> > >
> > > This is not the expected result.
> > >
> > > The input is treated as 180548043269214573494164592263168.
> > >
> > >      ( x:180548043269214561950911457875657 )
> > > 180548043269214573494164592263168
> > >
> > > Not the input I thought I was applying.
> > >
> > > An alternative is to postfix an 'x' to the end of the input.
> > >      180548043269214561950911457875657x A. i.30
> > > 20 12 4 29 7 17 22 11 2 27 28 23 6 21 9 3 24 10 26 13 15 1 18 8 25 19
> 0 5
> > > 16 14
> > >
> > > The expected result. But how do I achieve this for a defined function.
> > >
> > > Does not work either.
> > > ".@((":vector_anagram),x')"_    NB. same as x:
> > >
> > >
> > > Maybe there is a symbol that 13 : can be recognize to trigger the
> > extended
> > > datatype.
> > >
> > >
> > >
> > > Thank you for your help.
> > >
> > > Ak
> > > ----------------------------------------------------------------------
> > > 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