login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Submitted by : (unknown) at: 2007-11-17T21:59:17-08:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

This fails

axiom
exp(-0.02*t)

\label{eq1}e^{\left(-{{0.02}\  t}\right)}(1)
Type: Expression(Float)
axiom
% :: Expression Fraction Integer

\label{eq2}e^{\left(-{{1 \over{50}}\  t}\right)}(2)
Type: Expression(Fraction(Integer))
axiom
% :: Expression Float

\label{eq3}e^{\left(-{{0.02}\  t}\right)}(3)
Type: Expression(Float)

But this works

axiom
exp(-1*(1/50)*t)

\label{eq4}e^{\left(-{t \over{50}}\right)}(4)
Type: Expression(Integer)
axiom
% :: Expression Float

\label{eq5}e^{\left(-{{0.02}\  t}\right)}(5)
Type: Expression(Float)

Why are these expressions treated differently?

How can convert the first one to the second?

EXPR FRAC INT doesn't coerce to EXPR FLOAT --unknown, Tue, 10 May 2005 17:54:24 -0500 reply
axiom
(1/2*x)::EXPR FRAC INT

\label{eq6}{1 \over 2}\  x(6)
Type: Expression(Fraction(Integer))
axiom
%::EXPR FLOAT

\label{eq7}{0.5}\  x(7)
Type: Expression(Float)

Is Axiom confused? I am. --Bill Page, Tue, 10 May 2005 18:35:04 -0500 reply
If
axiom
exp(-0.02*t) :: Expression Fraction Integer

\label{eq8}e^{\left(-{{1 \over{50}}\  t}\right)}(8)
Type: Expression(Fraction(Integer))

then why?

axiom
exp(-1*(1/50)*t)

\label{eq9}e^{\left(-{t \over{50}}\right)}(9)
Type: Expression(Integer)

Is Axiom confused about the definition of the type Expression Integer? What exactly is it that is supposed to be an Integer in each case above?

Category: Axiom Compiler => Axiom Library Status: open => rejected

Expression R builds expressions with coefficients from R. Since Expression is closed under division, EXPR INT and EXPR FRAC INT cover the same amount of expressions. It seems to be part of axiom's philosophy not to support redundant application of domain constructors, at least in the interpreter. Other examples are FRAC FRAC INT or COMPLEX COMPLEX INT.

Martin




  Subject:   Be Bold !!
  ( 14 subscribers )  
Please rate this page: