From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Calculator: no exponent, full number ? Date: Fri, 07 Jun 2019 21:36:11 +0200 Message-ID: <878sud9oij.fsf@mbork.pl> References: <20190604154307.565d33cf@mistral> <87zhmwzn67.fsf@mbork.pl> <20190605095317.499f2082@mistral> <86tvd3sig6.fsf@zoho.eu> <875zpibtr3.fsf@mbork.pl> <86wohyodxs.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="6760"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: help-gnu-emacs@gnu.org, Ingemar Holmgren To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 07 22:28:42 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hZLTe-0001d5-7i for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Jun 2019 22:28:42 +0200 Original-Received: from localhost ([::1]:52982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZLTd-0005FA-A2 for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Jun 2019 16:28:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42211) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZKiL-0005yT-NT for help-gnu-emacs@gnu.org; Fri, 07 Jun 2019 15:39:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZKiI-0004yK-9y for help-gnu-emacs@gnu.org; Fri, 07 Jun 2019 15:39:48 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:49588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hZKiF-00043N-BF for help-gnu-emacs@gnu.org; Fri, 07 Jun 2019 15:39:45 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id C0EF4E662D; Fri, 7 Jun 2019 21:39:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mypeL91I1m0Z; Fri, 7 Jun 2019 21:39:01 +0200 (CEST) Original-Received: from localhost (jeden09-dwa27.echostar.pl [213.156.109.227]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 78AFBE662B; Fri, 7 Jun 2019 21:39:01 +0200 (CEST) In-reply-to: <86wohyodxs.fsf@zoho.eu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.110.48.8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:120820 Archived-At: On 2019-06-06, at 18:50, Emanuel Berg via help-gnu-emacs wrote: > Marcin Borkowski wrote: > >>> (defun hypotenuse (c1 c2) >>> (sqrt (+ (* c1 c1) (* c2 c2))) ) >> >> Just for the fun, let me mention that this is >> not a very good algorithm for computing the >> Pythagorean sum - it may happen that both the >> operands and the result lie within the bounds >> for the given type but this calculation blows >> up because of large squares overflowing. > > Well, first let it be known that Marcin is > a professional mathematician, famous for his Professional - maybe, famous - luckily not. > remarkable calculations. That said, the above > comment is on the computer side of things, > right? In the math world, what would happen is > just a very large triangle, again - right? Of course. There is no overflow in maths;-). >> Also, it is slow because of the need to >> compute square roots. Interestingly, there >> exists a clever algorithm that does not have >> these problems. > > Why don't you post it in Elisp to prove my > point one can use Elisp for math, even advanced > math! <3 Not enough time... Maybe in the future... >> It is used (among others) in Donald Knuth's >> METAFONT. The algorithm is described in the >> paper (using Emanuel's favorite format;-)): > > That's true, I frekking *love* Biblatex! [2] > >> @ARTICLE{5390405, >> author={C. {Moler} and D. {Morrison}}, >> journal={IBM Journal of Research and Development}, >> title={Replacing Square Roots by Pythagorean Sums}, >> year={1983}, >> volume={27}, >> number={6}, >> pages={577-581}, >> keywords={}, >> doi={10.1147/rd.276.0577}, >> ISSN={0018-8646}, >> month={Nov}, >> } > > Only I keep mine much neater :) "Mine" was autogenerated by some service on the web. Best, -- Marcin Borkowski http://mbork.pl