axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] Fixing < for expressions


From: Martin Rubey
Subject: [Axiom-developer] Fixing < for expressions
Date: Thu, 21 Jul 2005 17:11:15 +0200

William Sit writes:

 > Yes, this is not enough because you are singling out 'exp()' and 'pi()'. The
 > same type of problems would occur for any symbolic constant such as those
 > involving trigonometric functions, or algebraic numbers. 
 > 
 > > Ideally
 > > I would like triage to attempt to compare the numerical values of
 > > expressions if at all possible - something like this:
 > > 
 > >     triage(k1, k2) ==
 > >       n1:=numericIfCan(k1::S)
 > >       n2:=numericIfCan(k2::S)
 > >       n1 case Float and n2 case Float => B2Z(n1<n2)

This won't work, I think, because S is only an OrderedSet and does not implement
numericIfCan. The correct way to apply an operator in code is

evaluate(operator k, argument k)$

I think:

)di op evaluate

   [1] (BasicOperator,List D1) -> Union(D1,"failed")
            from BasicOperatorFunctions1 D1 if D1 has SETCAT

so you have to know D1, which would be S in our case. But the result is only in
S, there is no way to recover EXPR ??? from it.

In any case, I'd think that defining the ordering should be done in the domain
itself.

Martin





reply via email to

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