As some expressions involving 'floor' and 'ceil' did not simplify as I have expected, I have gone to basics. In ?trunc > Description it is stated:

ceil(x) = -floor(-x)

But 'simplify' does not seem to know about this equation as this expression should simplify to 0:

simplify(ceil(x)+floor(-x));

                         floor(-x) + ceil(x)

In principle, this seems to be a weakness in 'simplify'. For comparison, in Mathematica 5:

Simplify[Ceiling[x] + Floor[-x]]

                        0

And in Maxima 5.15:

ceiling(x)+floor(-x);

                        0

Also, this other one should simplify to 0:

simplify(floor(k/2)+ceil(k/2)-k) assuming k::integer ;

                      floor(k/2) + ceil(k/2) - k


Please Wait...