From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: RFC: Arbitrary-precision floats for Guile Date: Tue, 01 Feb 2011 21:37:25 +0100 Message-ID: References: <878vxzx3g3.fsf@yeeloong.netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296592378 25526 80.91.229.12 (1 Feb 2011 20:32:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Feb 2011 20:32:58 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 01 21:32:53 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 1PkMuC-0005lU-Cu for guile-devel@m.gmane.org; Tue, 01 Feb 2011 21:32:53 +0100 Original-Received: from localhost ([127.0.0.1]:56226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkMuB-0003m9-BJ for guile-devel@m.gmane.org; Tue, 01 Feb 2011 15:32:51 -0500 Original-Received: from [140.186.70.92] (port=34337 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkMts-0003jX-83 for guile-devel@gnu.org; Tue, 01 Feb 2011 15:32:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkMtm-0002sq-EO for guile-devel@gnu.org; Tue, 01 Feb 2011 15:32:27 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:54136 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkMtm-0002sa-Bp for guile-devel@gnu.org; Tue, 01 Feb 2011 15:32:26 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id A98853E1A; Tue, 1 Feb 2011 15:33:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=bs+FbiQXyLcqINQb3cL3+IMloXQ=; b=sPtqEA SzZqlt4X+ZdIElkeyY0DanSXSYzF2Wiiy5obDoaoLvX+mz5BzeNeAc96ovv6iSml VPf795Gynuz2IBCEwfdM68syQUr97awWtAj3I4r3QOr1RDy+CaGljdSvmJohwokR r5n3wkn2i0nSgZNHoxgXxWXLPSPr9FNHslRhU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=MDF0CP9UUsRoJDPnvoOBNmLTAMhLGchc kOLZQxW++nf1JYQ7DBrvtgpIFaA+0X0CwkkFVqrsa0pPWyXEgMZh5n7BmruktyBi VQWTGrHGmHlsqTzSOBX3AaFDPgMaYPYyoeBcl/8XjnuKNdcqAUrQR0Yaugo5ZITX Fcb4iCJ0rUA= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 97C183E19; Tue, 1 Feb 2011 15:33:16 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id CE1DC3E18; Tue, 1 Feb 2011 15:33:14 -0500 (EST) In-Reply-To: <878vxzx3g3.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Tue, 01 Feb 2011 08:57:32 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 7FAC084C-2E42-11E0-8B8B-F13235C70CBC-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:11491 Archived-At: Hi Mark, On Tue 01 Feb 2011 14:57, Mark H Weaver writes: > I want to add arbitrary-precision floats to Guile. > I'd use the mpf_t type from GNU MP. > > There would be a fluid whose value would determine the minimum > precision to use for inexact operators. A value of #f (the default) > would mean that normal floats would be used unless one of the operands > was a bigfloat. Procedures that produce inexact numbers (including > read and exact->inexact) would use the precision of the most precise > inexact operand contributing to the result, or the value of the fluid, > whichever is greater. What other procedures would use this fluid? Can you enumerate them? In (* inum flonum bigflonum), with what precision would the first multiplication be performed? Note that currently the compiler compiles it as (* (* inum flonum) bigflownum). I would like to avoid adding more core numeric types during the 2.0. I don't think we have time for a full implementation of this before 2.0, either. Is there a minimal change that you can make that adds this type? The same consideration applies to exact complex numbers. I wonder though: could we keep things simple and just have complex components as SCM values? In the common flonum case, we can allocate the SCM values inline, at the end of the complex SCM object. That's probably enough of a performance win that we can claim victory there, and avoid two kinds of complex numbers. Also, I would like for the mpfr dependency to be optional, if possible. > What do you think of this? Am I crazy? :) Possibly :) If it makes it in, great. ~Small changes can go into 2.0, at this point. But if it doesn't, that will just be a good reason to get a 2.2 out soonish. Cheers, Andy -- http://wingolog.org/