axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] axiom/aldor oddities


From: Martin Rubey
Subject: Re: [Axiom-developer] axiom/aldor oddities
Date: 19 Jan 2007 13:57:40 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Dear Franz,

I can only guess...

Franz Lehner <address@hidden> writes:

> ---BEGIN strange.as
> #include "axiom"
> 
> FPI ==> Fraction Polynomial Integer;
> 
> tfpi1(d:Polynomial Integer,n:PositiveInteger): Fraction Polynomial Integer == 
> {
>       import from Integer;
>       (1/factorial(n::Integer)^2)::FPI*d;
> }
3B
* 1 is interpreted as an Integer (because of import from Integer)

* factorial is interpreted as factorial: % -> % from Integer (again because of
  the import from Integer)

* ^ ditto

* but there is no / in Integer. I have no idea which function the compiler
  finds here. In any case:

> (4) -> tfpi1(x,3)
> Looking in Polynomial(Integer()) for ??200088  with code 250738832
> 
>      >> System error:
>      FOAM-USER::|fiRaiseException| is invalid as a function.

this looks like axiom couldn't find some function. It would be nice to know
which one, of course...

I think the following should work:

tfpi1(d:Polynomial Integer,n:PositiveInteger): Fraction Polynomial Integer == {
      import from Integer, Fraction Integer;
      (1/factorial(n::Integer)^2)::FPI*d;
}

or

tfpi1(d:Polynomial Integer,n:PositiveInteger): Fraction Polynomial Integer == {
      import from Integer;
      d/(factorial(n::Integer)^2)::(Polynomial Integer);
}

Martin





reply via email to

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