From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Calculator: no exponent, full number ?
Date: Thu, 6 Jun 2019 19:04:59 +0200 [thread overview]
Message-ID: <20190606170459.GA19929@tuxteam.de> (raw)
In-Reply-To: <86wohyodxs.fsf@zoho.eu>
[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]
On Thu, Jun 06, 2019 at 06:50:55PM +0200, 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
> 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?
>
> Assuming integers, how large can they be in
> Emacs Lisp? Eval us:
>
> most-positive-fixnum ; 536870911
> "Typical values are 2**29 − 1 on 32-bit and
> 2**61 − 1 on 64-bit platforms." [1]
[...]
Newer Emacsen support bignums:
(expt 71 71) => 275006373483461607657434076627252658495183350017755660813753981774508905998081919405140568848353397233796618192645698819765129996471
That said, calc itself supports bignums since
long.
Cheers
-- t
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2019-06-06 17:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 19:43 Calculator: no exponent, full number ? jonetsu
2019-06-04 22:42 ` Emanuel Berg via help-gnu-emacs
2019-06-05 11:15 ` Emanuel Berg via help-gnu-emacs
2019-06-05 4:11 ` Marcin Borkowski
2019-06-05 4:26 ` Emanuel Berg via help-gnu-emacs
2019-06-05 13:53 ` jonetsu
2019-06-05 23:47 ` Emanuel Berg via help-gnu-emacs
2019-06-06 14:50 ` Nick Dokos
2019-06-26 4:09 ` Xavier Maillard
2019-06-06 15:47 ` Marcin Borkowski
2019-06-06 16:50 ` Emanuel Berg via help-gnu-emacs
2019-06-06 17:04 ` tomas [this message]
2019-06-06 17:11 ` Emanuel Berg via help-gnu-emacs
2019-06-06 17:25 ` tomas
2019-06-07 19:36 ` Marcin Borkowski
2019-06-14 12:20 ` Van L
2019-06-14 13:26 ` Robert Pluim
2019-06-14 19:57 ` Stefan Monnier
2019-06-15 9:29 ` Van L
2019-06-14 19:43 ` Emanuel Berg via help-gnu-emacs
2019-06-15 9:23 ` Van L
-- strict thread matches above, loose matches on Subject: below --
2019-06-06 17:28 Joe Trivers via help-gnu-emacs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190606170459.GA19929@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).