Compute pi to base 12 using Python?

M.E.Farmer mefjr75 at hotmail.com
Fri Apr 15 02:18:06 EDT 2005


Dick Moores wrote:
> Paul Rubin wrote at 18:20 4/13/2005:
> >Dick Moores <rdm at rcblue.com> writes:
> > > I need to figure out how to compute pi to base 12, to as many
digits
> > > as possible. I found this reference,
> > > <http://mathworld.wolfram.com/Base.html>, but I really don't
> > > understand it well enough. Could someone show me how to do what I
need?
> >
> >Using the GNU "bc" utility:
> >
> >   $ bc -l
> >   bc 1.06
> >   Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation,
Inc.
> >   This is free software with ABSOLUTELY NO WARRANTY.
> >   For details type `warranty'.
> >   scale = 3000    # number of output places wanted
> >   obase = 12      # output base
> >   print 4 * a(1)  # pi = 4*arctan(1)
>
> I don't believe GNU "bc" is available for Windows, is it?
>
> Thanks,
>
> Dick Moores
> rdm at rcblue.com
Nice collection of unix tools, Cygwin not needed.
http://unxutils.sourceforge.net/
hth,
M.E.Farmer




More information about the Python-list mailing list