Subject: Declare Variable Even and Use floor and Ceil
From: Casper Thomsen
Date: Fri, 2 Oct 2009 17:33:14 +0200
Hello,
I have come across a small missing thing; let me illustrate.
If I do
(%i1) declare(e,even)$ floor(e/2);
Maxima will answer
(%o1) e/2
which is very nice. (Maple can't do that for instance!)
However, if I do
(%i2) declare(o,odd)$ floor(o/2);
I would expect Maxima to do
(%w1) (o-1)/2
but Maxima answers simply
(%o2) floor(o/2)
Likewise, I would expect
(%i3) ceil(e/2); ceil(o/2);
to give
(%w3) e/2
(%w4) (o+1)/2
but Maxima answers
(%o3) ceil(e/2)
(%o4) ceil(o/2)
I spend some time grep'ing the source trying to figure out where and how
to apply these changes, but I came to the conclusion that it'd probably
be much more efficient (for all of us) if I just explained my point
rather than trying to create a diff.
It is probably the same evaluation difference between floor and ceil
that makes this:
(%i1) declare(i,integer)$ floor(i); ceil(i);
(%o2) i
(%o3) ceil(i)
Greetings,
--
Casper Thomsen