From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Equality predicates, signed zeroes, R5RS and R6RS Date: Mon, 31 Jan 2011 17:42:01 -0500 Message-ID: <87wrlkwv9i.fsf@yeeloong.netris.org> References: <430524.11134.qm@web37903.mail.mud.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1296513895 32157 80.91.229.12 (31 Jan 2011 22:44:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2011 22:44:55 +0000 (UTC) Cc: "guile-devel@gnu.org" To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 31 23:44:51 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pk2UK-0000Oo-6o for guile-devel@m.gmane.org; Mon, 31 Jan 2011 23:44:51 +0100 Original-Received: from localhost ([127.0.0.1]:42209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pk2U5-0000Cs-VI for guile-devel@m.gmane.org; Mon, 31 Jan 2011 17:44:33 -0500 Original-Received: from [140.186.70.92] (port=45719 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pk2Tv-000055-O9 for guile-devel@gnu.org; Mon, 31 Jan 2011 17:44:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pk2Rm-0006Di-4E for guile-devel@gnu.org; Mon, 31 Jan 2011 17:42:11 -0500 Original-Received: from world.peace.net ([216.204.32.208]:47258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pk2Rm-0006DY-0w for guile-devel@gnu.org; Mon, 31 Jan 2011 17:42:10 -0500 Original-Received: from ip68-9-118-38.ri.ri.cox.net ([68.9.118.38] helo=freedomincluded) by world.peace.net with esmtpa (Exim 4.69) (envelope-from ) id 1Pk2Rg-00037O-KY; Mon, 31 Jan 2011 17:42:04 -0500 Original-Received: from mhw by freedomincluded with local (Exim 4.69) (envelope-from ) id 1Pk2Rd-0006TW-Oo; Mon, 31 Jan 2011 17:42:01 -0500 In-Reply-To: <430524.11134.qm@web37903.mail.mud.yahoo.com> (Mike Gran's message of "Mon, 31 Jan 2011 13:36:48 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 216.204.32.208 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11477 Archived-At: Mike Gran writes: > As an aside, as of a couple of months ago, it was possible to create > the following seven versions of zero=C2=A0in Guile using the default read= er. > > 0, =C2=B10.0, =C2=B10.0=C2=B10.0i=20 Really? I don't understand how this could have happened. mem2complex uses scm_make_rectangular to create complex numbers, and scm_make_rectangular calls scm_c_make_rectangular, which creates a real if the imaginary part is zero. I looked at the history, and I don't see any relevant changes to this behavior in the last several years at least, unless the default reader formerly used something other than mem2complex, and created the numbers without scm_c_make_rectangular. In any case, I will soon submit patches to allow us to create all seven of these zeroes again, as required by R6RS. > But as a physicist, I declare that this is all madness.=20 I agree that it doesn't sit entirely well with me either. I would like for computer languages to be mathematically rigorous in their behavior. However, having looked closely at the rationale behind the signed zeroes, I can see why the designers of IEEE 754 mandated them. They are important when working with functions involving branch cuts, as the cuts are approached from either side and underflow may change a small number into a zero. Making robust numerical programs is unfortunately a messy business. Best, Mark