[Maxima] display all results of sqrt()

Robert Dodier robert.dodier at gmail.com
Wed Aug 19 13:21:01 CDT 2009


On Wed, Aug 19, 2009 at 7:50 AM, Leo Butler<l.butler at ed.ac.uk> wrote:

> (%i2) sqt(x) := block([], if listp(x) then map(sqt,x) else
> [-sqrt(x),sqrt(x)]);

I can't really do justice to this topic, so I'll settle for quibbling today ...

I want to discourage cruft. The "block" construct isn't needed, and
even if there were multiple expressions, in the absence of local variables
you can write just (e1, e2, e3) . It's hard enough to understand
what's going on without extra clutter.

Aside from that, this question of representing multiple values is
very interesting and I'm pretty sure we could figure out a way to
handle it in a way that is both useful and well-founded. It seems likely
that multiple values could be represented as sets. We probably
have to strengthen Maxima's ability to handle sets to make it work.

FWIW

Robert Dodier


More information about the Maxima mailing list