Maxima gives incorrect results with ceiling



Mike Hansen wrote:
>When working with large numbers and floating point arithmetic, maxima
>gives incorrect answers.  For example,
>
>(%i5) ceiling(factorial(50)/exp(1));
>(%o5)  11188719610782480421414879249141773426630319613740326700720324608
>
>The correct result should be
>11188719610782480504630258070757734324011354208865721592720336801 .
>What is the best way to go about fixing this issue?

I don't know about the best way, but an easy way is to use
bigfloats and set fpprec high enough.

(%i6) fpprec:100;
(%o6)                                 100
(%i7) ceiling(factorial(50)/exp(1b0));
(%o7)
11188719610782480504630258070757734324011354208865721592720336801

I haven't tested what the smallest fpprec is that works, but 100
obviously is enough.

'Andreas