Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #224772
| From | The Wanderer <wanderer@fastmail.fm> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: what calculator do you use? |
| Date | 2020-07-14 01:10 +0200 |
| Message-ID | <AsfKa-5Y7-5@gated-at.bofh.it> (permalink) |
| References | <As1ea-5sA-15@gated-at.bofh.it> <As3zk-70m-7@gated-at.bofh.it> <As4c1-7d6-1@gated-at.bofh.it> <As5KN-8f3-11@gated-at.bofh.it> |
| Organization | This space intentionally left blank. |
[Multipart message — attachments visible in raw view] - view raw
On 2020-07-13 at 08:23, Greg Wooledge wrote:
> On Mon, Jul 13, 2020 at 06:47:51AM -0400, The Wanderer wrote:
>
>> In some contexts it could even need fewer; for example, calc (as
>> shipped in Debian) provides the built-in function 'pi()', which
>> takes a precision - expressed as a value between zero and one - and
>> returns pi to that level of precision.
>
> I do not understand this description. How many decimal places do
> you get for a precision of, say, 0.5?
(It turns out I got the specification of what the precision can be
expressed as wrong, and "precision" may not be the correct term for it
anyway; see below.)
I don't understand the full algorithm myself, but the output seems
coherent:
$ calc
C-style arbitrary precision calculator (version 2.12.7.2)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]
; pi(.5)
3
; pi(.1)
3.1
; pi(.9)
2.7
; pi(.05)
3.15
; pi(.0005)
3.1415
; pi(.00005)
3.1416
; pi(.00001)
3.14159
; pi(.00009)
3.1416
I generally just use something like 'pi(.0000000000000001)' (i.e., hold
down the 0 key for a while in between . and 1), and that produces all
the precision I could really care for. The limit that gets printed (at
least with default configuration) appears to be
; pi(.0000000000000000000000000000000000000000000000000001)
~3.14159265358979323846
and you can get that same visible result with a much shorter precision
value. I expect that there are configuration settings which will
increase the displayed precision, but I've never needed to find them.
Also, it turns out that it accepts values >=1 and <=0 as well:
; pi(5)
5
; pi(10)
0
; pi(50)
0
; pi(3)
3
; pi(4)
4
; pi(2)
4
; pi(-1)
3
; pi(0)
zero epsilon value for pi
; pi(1)
3
The results just aren't very useful.
>> The list of built-in functions in the bc man page is very short,
>> and doesn't include any such thing, so unless something has added
>> one without the man page getting updated anything that needs to use
>> pi is going to take more typing than with calc.
>
> True. But it's not a *huge* amount of typing.
>
> unicorn:~$ bc -l
Yep - as soon as I saw someone point out what this flag did, I figured
this would be in there somewhere. (I didn't figure it out from looking
the flag up in the man page, but that's me.)
> bc 1.07.1
> Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
> This is free software with ABSOLUTELY NO WARRANTY.
> For details type `warranty'.
> 4*a(1)
> 3.14159265358979323844
Definitely convenient, but also requires knowing more about math than
I've managed to internalize over the decades to figure out. I would not
have thought of multiplying by the arctangent of 1 (or of anything) to
arrive at pi.
--
The Wanderer
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
what calculator do you use? kaye n <guikaye@gmail.com> - 2020-07-13 09:40 +0200
Re: what calculator do you use? Alex Mestiashvili <amestia@rsh2.donotuse.de> - 2020-07-13 09:50 +0200
Re: what calculator do you use? Andrei POPESCU <andreimpopescu@gmail.com> - 2020-07-13 09:50 +0200
Re: what calculator do you use? Linux-Fan <Ma_Sys.ma@web.de> - 2020-07-13 12:40 +0200
Re: what calculator do you use? rhkramer@gmail.com - 2020-07-13 13:30 +0200
Re: what calculator do you use? Klaus Singvogel <deb-user-ml@singvogel.net> - 2020-07-13 13:50 +0200
Re: what calculator do you use? Greg Wooledge <wooledg@eeg.ccf.org> - 2020-07-13 14:20 +0200
Re: what calculator do you use? rhkramer@gmail.com - 2020-07-13 17:20 +0200
Re: what calculator do you use? Eric S Fraga <e.fraga@ucl.ac.uk> - 2020-07-13 14:30 +0200
Re: what calculator do you use? Jörg-Volker Peetz <jvpeetz@web.de> - 2020-07-14 11:10 +0200
Re: what calculator do you use? John Hasler <jhasler@newsguy.com> - 2020-07-14 14:30 +0200
Re: what calculator do you use? Brad Rogers <brad@fineby.me.uk> - 2020-07-13 10:00 +0200
Re: what calculator do you use? Marco Möller <talby@debianlists.mobilxpress.net> - 2020-07-13 10:00 +0200
Re: what calculator do you use? <tomas@tuxteam.de> - 2020-07-13 10:20 +0200
Re: what calculator do you use? Michael Lange <klappnase@freenet.de> - 2020-07-13 10:30 +0200
Re: what calculator do you use? Ed Redd <edredd7@gmail.com> - 2020-07-13 10:40 +0200
Re: what calculator do you use? Joe <joe@jretrading.com> - 2020-07-13 11:00 +0200
Re: what calculator do you use? Eric S Fraga <e.fraga@ucl.ac.uk> - 2020-07-13 11:40 +0200
Re: what calculator do you use? Florent Rougon <f.rougon@free.fr> - 2020-07-13 14:50 +0200
Re: what calculator do you use? Eric S Fraga <e.fraga@ucl.ac.uk> - 2020-07-13 18:10 +0200
Re: what calculator do you use? "Thomas Schmitt" <scdbackup@gmx.net> - 2020-07-13 19:30 +0200
Re: what calculator do you use? Eric S Fraga <e.fraga@ucl.ac.uk> - 2020-07-14 08:20 +0200
Re: what calculator do you use? ghe2001 <ghe2001@protonmail.com> - 2020-07-13 20:20 +0200
Re: what calculator do you use? Reco <recoverym4n@enotuniq.net> - 2020-07-13 12:10 +0200
Re: what calculator do you use? The Wanderer <wanderer@fastmail.fm> - 2020-07-13 12:50 +0200
Re: what calculator do you use? echo test <echotest09@gmail.com> - 2020-07-13 13:40 +0200
Re: what calculator do you use? Reco <recoverym4n@enotuniq.net> - 2020-07-13 13:40 +0200
Re: what calculator do you use? Greg Wooledge <wooledg@eeg.ccf.org> - 2020-07-13 14:30 +0200
Re: what calculator do you use? The Wanderer <wanderer@fastmail.fm> - 2020-07-14 01:10 +0200
Re: what calculator do you use? David Wright <deblis@lionunicorn.co.uk> - 2020-07-14 03:00 +0200
Re: what calculator do you use? The Wanderer <wanderer@fastmail.fm> - 2020-07-14 03:10 +0200
Re: what calculator do you use? Greg Wooledge <wooledg@eeg.ccf.org> - 2020-07-14 13:30 +0200
Re: what calculator do you use? Anssi Saari <as@sci.fi> - 2020-07-13 13:40 +0200
Re: what calculator do you use? Weaver <weaver@riseup.net> - 2020-07-13 13:50 +0200
Re: what calculator do you use? John Hasler <jhasler@newsguy.com> - 2020-07-13 14:40 +0200
Re: what calculator do you use? Charles Curley <charlescurley@charlescurley.com> - 2020-07-13 15:40 +0200
Re: what calculator do you use? Charles Curley <charlescurley@charlescurley.com> - 2020-07-13 15:40 +0200
Re: what calculator do you use? Cindy Sue Causey <butterflybytes@gmail.com> - 2020-07-13 19:20 +0200
Re: what calculator do you use? Celejar <celejar@gmail.com> - 2020-07-13 15:50 +0200
Re: what calculator do you use? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2020-07-13 17:30 +0200
Re: what calculator do you use? Wolf Halton <wolf.halton@gmail.com> - 2020-07-13 17:50 +0200
Re: what calculator do you use? David Wright <deblis@lionunicorn.co.uk> - 2020-07-13 21:20 +0200
Re: what calculator do you use? Ben Caradoc-Davies <ben@transient.nz> - 2020-07-13 22:00 +0200
Re: what calculator do you use? Nate Bargmann <n0nb@n0nb.us> - 2020-07-13 19:30 +0200
Re: what calculator do you use? Ben Caradoc-Davies <ben@transient.nz> - 2020-07-13 21:50 +0200
csiph-web