bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calculator thinks 12!! = 0


From: Eli Barzilay
Subject: Re: calculator thinks 12!! = 0
Date: 02 Jul 2007 21:35:47 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Joe Wells <jbw@macs.hw.ac.uk> writes:

> Dear Emacs gurus,
> 
> To reproduce the problem, type "M-x calculator RET 12 ! !".  You will
> see the result "0".
> 
> More reasonable behavior would be what calculator does on 171!, which
> is return "inf".
> 
> Additional strange behavior can be found by calculating 11!!, which
> seems to run forever (or at least longer than I had the patience to
> wait).
> 
> The same poor behaviors can be observed also in Emacs 21.4 with the
> "-q" command line option, so this is not a new bug and it does not
> appear to depend on my configuration.

The calculator's factorial is nothing too sophisticated...  It was
mostly a proof of concept.  Some of the things that you see are a
result of what you get with:

  (truncate 479001600.0)

(the calculator catches the error and uses 0 instead).  I have a fix
for that -- if someone tells me where to send a new version to, I'll
do that so it gets in.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]