Re: sqrt(-1) and %i
"Bill Page" <[email protected]>
| Newsgroups | gmane.comp.mathematics.axiom.user |
|---|---|
| Message-ID | <[email protected]> |
On 03 Jul 2007 02:24:13 +0200, Martin Rubey wrote: > "Bill Page" writes: > > > but not if through some more complex computation I end up with a type like this: > > > > (4) -> q:Expression Fraction Integer:=sin(1)*sqrt(-1) > > you shouldn't end up with a type like this. The interpreter doesn't like it. > Thanks, Martin. That is exactly the hint that I needed. After feeling annoyed about being told: "The interpreter doesn't like it." (Since Axiom certainly doesn't complain!) I realized that you are right and why: The Expression domain in Axiom is really just an extension of the domain of rational functions, i.e. Fraction Polynomial. So what I wrote was kind of like: q:Polynomial Fraction Fraction Integer:= ... I should be more careful not to write code that generates this situation. But I still expect the interpreter to complain Note for Axiom developers: Expression(R: OrderedSet) is too general. Perhaps it should not be possible to pass a domain R that has QuotientFieldCategory(S) for some domain S. > > > > +---+ > > (4) sin(1)\|- 1 > > Type: Expression Fraction Integer > > > > (8) -> map(i+->i::INT, q) > > +---+ > (8) sin(1)\|- 1 > Type: Expression Integer > > But that's a hack. > Yes, that's good - it's just that the meaning of 'map' in this context is obscure until one recalls that Expression is an extended rational function or map is applying the function to both the numerator and the denominator. I guess the Expression domain is rather poorly named... Regards, Bill Page.