axiom-developer
[Top][All Lists]
Advanced

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

RE: [Axiom-developer] I can't translate from the interpreter tothecompil


From: Page, Bill
Subject: RE: [Axiom-developer] I can't translate from the interpreter tothecompiler
Date: Tue, 28 Mar 2006 12:19:54 -0500

On Tuesday, March 28, 2006 11:49 AM I wrote:

> 
> On Tuesday, March 21, 2006 3:48 PM Francois Maltey wrote:
> > 
> > In the interpreter I have this single line :
> > 
> > fct (n, x) == eval (real ((c + %i * s)^n), [c, s], [cos x, sin x])
> > 
> > I want to add this function in manip.spad... :-(
> > ...
> 
> Here is another version of this package in SPAD that is a
> little closer to the version that works in the interpreter:
> 

And here is a still simpler version. At least in this
example, the call to 'eval' is no longer necessary.

-------

)abbrev package TEST Test
EXPR ==> Expression Integer

Test: with
    fct:(Integer,EXPR)->EXPR
  == add
    import Complex EXPR

    fct(n:Integer, x:EXPR):EXPR == real(complex(sin(x),cos(x))**n)

---------

Regards,
Bill Page.




reply via email to

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