Re: Ugly representation of square roots in console mode

Martin Rubey <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
"Alasdair McAndrew" <[email protected]> writes:

> Axiom represents square roots by a mixture of ascii symbols which are
> supposed to approximate the square root sign, so that sqrt(2)+sqrt(3) looks
> like
> 
>     +-+    +-+
>    \|3  + \|2
> 
> (You'll need to view the above in a monospaced font).  And n-th roots are
> even worse: 2^(1/3)+3^(1/4) comes out as
> 
>     4+-+   3+-+
>     \|3  + \|2
> 
> This is just ugly.  

It seems that taste differs: I find the above very beautiful and nice to read.

> Can axiom, be coerced to represent n-th and square roots in one of these
> simpler forms?

I think that should be doable: look at

(13) -> (2^(1/3))::OUTFORM::SEX

   (13)  (ROOT 2 3)
                                                            Type: SExpression
(14) -> (2^(1/x))::OUTFORM::SEX

   (14)  (** 2 (/ 1 x))
                                                            Type: SExpression

so you could just modify the responsible lines in OutputForm

        root:    $ -> $
          ++ root(f) creates a form for the square root of form f.
        root:    ($, $) -> $
          ++ root(f,n) creates a form for the nth root of form f.


        root a     == [eform ROOT,    a]
        root(a,b)  == [eform ROOT,    a, b]

to your liking, i.e., something like

        root a     == a ** (1/2)
        root(a, b) == a ** (1/b)

You should then recompile outform.spad, and see whether it works.

Martin
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.