axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Axiom-developer] Math Chat


From: Page, Bill
Subject: RE: [Axiom-developer] Math Chat
Date: Wed, 15 Dec 2004 21:39:26 -0500

On Wednesday, December 15, 2004 7:52 PM Bob McElrath
> 
> Well I sat down to try to find something to allocate my
> bounty for, andI  keep running into walls.  This time
> it was Bill's observation that %pi::Float works but
> %e::Float doesn't...so I dug into the code...

I think it was Martin. But no matter...

> I keep wanting to ask dumb questions so I created an
> IRC channel for axiom: #axiom-developer on irc.freenode.net.
> This is for rapid communication, and is a good way to give
> support.  I hope others will join me.

Sorry, I would but I can't IRC from were I'am at right now.

Briefly %pi is a macro for pi()
        %e is a macro for exp(1)

See

)display op pi

)display op exp

Examining the differences between %pi and %e in Axiom
takes you quite quickly down into the details of types
and conversions... worth the trip, I think!

It is important to remember these distinctions:

:: is a conversion from one type to another

@ specifies a desired target type

$ specifies exactly what package to call

In Axiom the type of pi() is Pi. This might seem strange
at first until you think of the importance of %pi in many
areas of mathematics. It is convenient to have it's special
properties encoded in a special type. Try

  )show Pi

to see all of the operations defined in this domain.
Notice that expressions like

  %pi+1

are also of type Pi.

%e on the other hand is of type Expression Integer.

We can convert %pi to the same type as %e

  pI:Expression Integer:=%pi

But then objects of type Expression Integer cannot
be converted to Float (in general)

  pI::Float

You would think that we could still do

  address@hidden

to request the target type Float by Axiom says
no.

In fact I think that it is strange that Axiom
allows

  pi()::Float

but it turns out that Float does have a function called
by pi()$Float since

  Float has TRANFUN

etc. etc.

Exercise: what is this?

  pi$Float

Have fun!

Regards,
Bill Page.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]