Re: A little print problem

"Bill Page" <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
On 10/16/07, Alasdair McAndrew <[email protected]> wrote:
> Here it is:
>
> F:=FFP(PF 2,x^3+x+1)
> x:=generator()$F
>  for i in 0..7 repeat print [i,x^i]
>
>     [0,1]
>    [1,%D]
>          2
>    [0,%D ]
>     [1,%D + 1]
>         2
>     [0,%D  + %D]
>         2
>     [1,%D  + %D + 1]
>         2
>     [0,%D  + 1]
>    [1,1]
>
> Note that because of the PF 2, the values of i in the lists to be printed
> are automatically reduced mod 2.  But this is not what I want - I want the
> printed values of i to range from 0 to 7.   How can I do this, given that
> print only takes one argument?
>

Try this:

(9) -> for i in 0..7 repeat output(i::String,x^i)
   0 1
   1 %A
       2
   2 %A
   3 %A + 1
       2
   4 %A  + %A
       2
   5 %A  + %A + 1
       2
   6 %A  + 1
   7 1
                                                   Type: Void

Regards,
Bill Page.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.