From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neon Absentius Newsgroups: gmane.emacs.help Subject: Re: Bug in Calc? Date: Wed, 7 Sep 2005 11:42:44 +0000 Message-ID: <20050907114244.GC28822@SDF.LONESTAR.ORG> References: <87hdcydkvh.fsf@vh213602.truman.edu> <20050906213348.GE12694@SDF.LONESTAR.ORG> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126096411 26334 80.91.229.2 (7 Sep 2005 12:33:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2005 12:33:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 07 14:33:26 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ECz5i-0003WI-3Y for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Sep 2005 14:31:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ECz8F-000768-8K for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Sep 2005 08:34:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ECye6-0006NV-3Q for help-gnu-emacs@gnu.org; Wed, 07 Sep 2005 08:03:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ECydh-0006Ai-Qt for help-gnu-emacs@gnu.org; Wed, 07 Sep 2005 08:02:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ECyWb-0004GM-S9 for help-gnu-emacs@gnu.org; Wed, 07 Sep 2005 07:55:34 -0400 Original-Received: from [192.94.73.21] (helo=sdf.lonestar.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ECyOa-0003Ow-3w for help-gnu-emacs@gnu.org; Wed, 07 Sep 2005 07:47:16 -0400 Original-Received: from sdf.lonestar.org (IDENT:absent@otaku.freeshell.org [192.94.73.2]) by sdf.lonestar.org (8.13.1/8.12.10) with ESMTP id j87BgiBE016171 for ; Wed, 7 Sep 2005 11:42:46 GMT Original-Received: (from absent@localhost) by sdf.lonestar.org (8.13.1/8.12.8/Submit) id j87BgihP017861 for help-gnu-emacs@gnu.org; Wed, 7 Sep 2005 11:42:44 GMT Original-To: help-gnu-emacs@gnu.org Mail-Followup-To: Neon Absentius , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <20050906213348.GE12694@SDF.LONESTAR.ORG> User-Agent: Mutt/1.4.2.1i X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:29290 Archived-At: On Tue, Sep 06, 2005 at 09:33:48PM +0000, Neon Absentius wrote: > there seems to be a bug: After I give 'm v' if I ask calc to > simplify the expression 'a b - b a' it leaves it as is which is as > expected. However when I ask it to expand '(a+b)^2' it returns > 'a^2 + 2 b a + b^2' which is of course wrong if a and b don't commute. > This happens both with emacs-multi-tty (22.0.50) and whith emacs > 21.4.1 on a Debian testing/unstable. The bug manifsts itself also > for the expansion of '(a+b)^3' however calc expands '(x+y)(x-y)' > into 'x^2 + y x - x y + y^2'. Strange! Maybe not so strange. Probably calc uses formulae (the binomial expansion?) to expand the power instead of fully distributing the multiplication over the addtition "by hand", so to speak. Of course the binomial expansion is not valid if the variables involved do not commute. I am not sure how to check if this is indeed the reason for the bug. -- Most precious among the relics remaining of Peter's skeleton in the Vatican are 29 fragments of one of his skulls. (St. Peter's other skull is preserved in a reliquary at the Cathedral of St. John Lateran.) -- Frank R. Zindler, "Of Bones and Boners"