From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Sat, 04 Aug 2018 10:33:27 -0600 Message-ID: <87k1p6m6qw.fsf@tromey.com> References: <87o9fbbw1t.fsf@tromey.com> <83wotxaiwi.fsf@gnu.org> <86k1pxmvmx.fsf@gmail.com> <87efg4a9xc.fsf@tromey.com> <87a7qr8cz7.fsf@tromey.com> <86tvoy3je9.fsf@gmail.com> <86bmb0vbxf.fsf@gmail.com> <87k1pnfcg1.fsf@tromey.com> <86sh4b1833.fsf@gmail.com> <861sbgz3dm.fsf@gmail.com> <83a7q4ufxp.fsf@gnu.org> <86in4resc8.fsf@gmail.com> <831sbfvl11.fsf@gnu.org> <8636vv7ohh.fsf@gmail.com> <83y3dntwsw.fsf@gnu.org> <83wot7tkdh.fsf@gnu.org> <87y3dnyzkl.fsf@tromey.com> <42060bb4-3535-3b03-e007-0ae68134a30b@cs.ucla.edu> <87tvobywph.fsf@tromey.com> <87600qza2i.fsf@Rainer.invalid> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1533400338 28407 195.159.176.226 (4 Aug 2018 16:32:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 4 Aug 2018 16:32:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Achim Gratz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 04 18:32:14 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flzTR-0007IS-D2 for ged-emacs-devel@m.gmane.org; Sat, 04 Aug 2018 18:32:13 +0200 Original-Received: from localhost ([::1]:55630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flzVX-000463-RX for ged-emacs-devel@m.gmane.org; Sat, 04 Aug 2018 12:34:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flzUk-00045u-56 for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:33:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flzUg-0007jI-6A for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:33:34 -0400 Original-Received: from gateway36.websitewelcome.com ([192.185.193.119]:24732) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1flzUf-0007it-UW for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:33:30 -0400 Original-Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway36.websitewelcome.com (Postfix) with ESMTP id B50A3400DC0C1 for ; Sat, 4 Aug 2018 10:36:07 -0500 (CDT) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id lzUefROZ4PvAdlzUefTK1X; Sat, 04 Aug 2018 11:33:28 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iC4PjBcSrIRNYO2zEaekfo5hQX55sDbN78Xq/8c/lD8=; b=PEF1EUKkO97ovx0OW8m301wt2V MPXlcaHQ8/u8kQrbxRcXanvIQttUGG/JmzPA+h39z3EixDJnlbDA1bkDKy2i9Rf/xbfhwJOu3YERD nD6yHY6PrVBUGxp37dpr4X3bk; Original-Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:43130 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1flzUe-001ZHS-I9; Sat, 04 Aug 2018 11:33:28 -0500 X-Attribution: Tom In-Reply-To: <87600qza2i.fsf@Rainer.invalid> (Achim Gratz's message of "Sat, 04 Aug 2018 12:43:17 +0200") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.85.72 X-Source-L: No X-Exim-ID: 1flzUe-001ZHS-I9 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-85-72.hlrn.qwest.net (bapiya) [75.166.85.72]:43130 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.193.119 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228168 Archived-At: >>>>> "Achim" == Achim Gratz writes: Achim> Tom Tromey writes: Paul> min and max propagate any NaNs they find. >> >> This part I don't understand, since my mental mode of min/max is that >> they are iteratively applying < or > Achim> The point of having NaN at all is to set aside a tiny bit of the symbol Achim> space for floating point numbers to encode certain error conditions and Achim> propagate them in-band. Otherwise they'd need to be signalled via side Achim> channels like traps and exceptions, which usually significantly slow Achim> down the error-free cases also or complicate the code even further. Achim> Getting an NaN indicates that your computation has left the domain it Achim> was defined in. So no matter what you do, after you get an NaN this Achim> indication must be preserved, hence all results must propagate NaN until Achim> you get to the point where you do error handling. Yes, I understand. What specifically is weird about this situation, for me, is that min and max aren't like arithemetic operations like + or -. And, the naive approach to writing min or max would not always (depending on argument ordering) preserve NaN, because min and max, presumably, are defined in terms of comparisons -- which always return false with NaN. Anyway, no big deal, it's easy to preserve these semantics with bignum as well. Tom