From: michael@cadilhac.name (Michaël Cadilhac)
To: bob@rattlesnake.com
Cc: emacs-devel@gnu.org
Subject: Possible bug in `expt'. (was: calc: E command hangs Emacs.)
Date: Fri, 21 Sep 2007 13:49:20 +0200 [thread overview]
Message-ID: <87myvgkzlr.fsf_-_@cadilhac.name> (raw)
In-Reply-To: <E1IYgkh-000069-ME@fencepost.gnu.org> (Robert J. Chassell's message of "Fri, 21 Sep 2007 07:32:55 -0400")
[-- Attachment #1.1: Type: text/plain, Size: 1965 bytes --]
"Robert J. Chassell" <bob@rattlesnake.com> writes:
> Please don't confuse us even when the original title is wrong!
> As a first sentence in the body of your message please write
>
> The following is Emacs Lisp, not Emacs Calc mode even though the
> title talks about Emacs Calc mode
Well, you know, the `References' field of my previous message is here if
you need context. The body of the text was all you needed, and it was
just pointing out a bug in the (expt) function, but sorry for the
misleading subject.
> In the body of your message, you attributed the Emacs Lisp to Yu Jie,
> which I think is correct:
Why, not quite. Yu Jie is quoted with `>', not `>>'.
> "yu jie" <yujie052@gmail.com> writes:
>
> >> (let ((x -1))
> >> (while (condition-case nil
> >> (message "1.Expt is %e" (expt 10.0 x))
> >> (error nil))
> >> (message "1.`x' is now %d" (setq x (* 2 x))))
> >> (message "2.`x' is now %d" (setq x (/ x 2)))
> >> (while (condition-case nil
> >> (message "3.Expt is %e" (expt 10.0 x))
> >> (error nil))
> >> (message "3.`x' is now %d" (setq x (1- x))))
> >> (+ x 2))
That expression leads to a weird behavior on Yu's computer. In fact, it
never gets out the first loop, and `x' reaches 0 without any error.
> That expression is for Emacs Lisp, not Emacs Calc.
> In Emacs Calc mode, E computes the exponential, i.e., `e' raised to the
> power of a number you have given it.
And this function uses (expt), which is buggy.
Hope everybody understands the matter now.
--
| Michaël `Micha' Cadilhac | 21 seems like a good value: half of |
| http://michael.cadilhac.name | of 42 and just old enough to drink! |
| JID/MSN: | Why would you want to change it? |
`---- michael.cadilhac@gmail.com | -- Stefan Monnier - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2007-09-21 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 1:14 calc: E command hangs Emacs yu jie
2007-09-18 14:16 ` Michaël Cadilhac
[not found] ` <42b562540709181923t54c3876of89a0c3322b459cc@mail.gmail.com>
2007-09-19 15:01 ` Michaël Cadilhac
[not found] ` <42b562540709191805tdbc3da4xf0f8d0cc2456cada@mail.gmail.com>
[not found] ` <876425n5gg.fsf@cadilhac.name>
[not found] ` <42b562540709201741s28d34896h9c6a69b8db676794@mail.gmail.com>
2007-09-21 9:25 ` Michaël Cadilhac
[not found] ` <E1IYgkh-000069-ME@fencepost.gnu.org>
2007-09-21 11:49 ` Michaël Cadilhac [this message]
[not found] ` <42b562540709232026s650e98ebgbeb780881565c0fa@mail.gmail.com>
2007-09-24 6:49 ` Michaël Cadilhac
2007-10-01 9:17 ` Michaël Cadilhac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87myvgkzlr.fsf_-_@cadilhac.name \
--to=michael@cadilhac.name \
--cc=bob@rattlesnake.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.