|
From: | William Sit |
Subject: | Re: [Axiom-math] if-expression and variables |
Date: | Mon, 02 May 2011 21:43:54 -0400 |
(Mathematica provides a "notation" to hold the expression, for example, Nest[test1,y,n]), in effect, creating a new function through composition.)
The problem in Axiom is, however, still due to the dual (and automatically selected) meanings of "y < 10". If we qualify the "<" operation by "<($Integer)", then Axiom will refuse to evaluate "y <($Integer) 10" because y is not known to be of type Integer. Axiom announces an error, while Mathematica returns the input.
William On Sat, 30 Apr 2011 20:40:28 +0200 Stefan Karrmann <address@hidden> wrote:
Dear all,I'm new to axiom and have a problem with piecewise functions.test1 (x | x < 10) == 2*x test1 (x | x < 10) == 5*x^2 test1-> test1 (x | x < 10) == 2xtest1 (x | ^ x < 10) == 5xType: FunctionCalledtest1 y -> 2 5yI expected something like (if y < 10 then 2*y else 5*y**2).How is it possible to pass a Variable to a piecewise function respectingthe pieces?PS: Using a block and => or explicit if-then-else does not help.-- Kind regards, Stefan _______________________________________________ Axiom-math mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/axiom-math
William Sit, Professor Emeritus Mathematics, City College of New York Office: R6/291D Tel: 212-650-5179 Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/
[Prev in Thread] | Current Thread | [Next in Thread] |