Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-21 Thread Raymond Hettinger
On Feb 21, 12:08 am, Mark Dickinson wrote: > On Feb 20, 8:08 am, Raymond Hettinger wrote: > > > [...] > > >>> n * e > > > 3.1415926 > Very neat!  Is it supposed to be obvious why this gives an > approximation to pi?  If so, I'll think about it a bit more;  if not, > do you have any references?

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-21 Thread Mark Dickinson
On Feb 20, 8:08 am, Raymond Hettinger wrote: > [...] > >>> n * e > > 3.1415926 > > Compute ð ± e by counting Mandlebrot set iterations :-) Very neat! Is it supposed to be obvious why this gives an approximation to pi? If so, I'll think about it a bit more; if not, do you have any references?

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Ben Finney
Anssi Saari writes: > Ben Finney writes: > > It [appeared correctly] in my reader. Perhaps your server has > > encoding trouble? > > He (or rather Google) used iso-8859-7 as a character set, which is the > Latin/Greek alphabet and definitely has pi at 0xF0. Not exactly a > common character set t

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Martin v. Loewis
> eps would be a better name than e. py> ε = 10.0 ** -7; n = 0; z = c = complex(-0.75, ε) py> while abs(z) < 2.0: ... n += 1 ... z = z * z + c ... py> π = n * ε py> print(π) 3.1415926 Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Roy Smith
In article <87oc679bl2@benfinney.id.au>, Ben Finney wrote: > Raymond Hettinger writes: > > > Compute � � e by counting Mandlebrot set iterations :-) > > Very cool! I love � nerdery. > > > Raymond Hettinger writes: > > > > Compute ð ± e by counting Mandlebrot set iterations :-)

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Anssi Saari
Ben Finney writes: > Raymond Hettinger writes: > >> Compute π ± e by counting Mandlebrot set iterations :-) > > Very cool! I love π nerdery. > > > Raymond Hettinger writes: > >> > Compute ð ± e by counting Mandlebrot set iterations :-) >> >> That should be: pi plus-or-minus e > > It was in my

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Steven D'Aprano
On Sun, 20 Feb 2011 00:08:58 -0800, Raymond Hettinger wrote: e = 10.0 ** -7; n = 0; z = c = complex(-0.75, e) while abs(z) < 2.0: > n += 1 > z = z * z + c > n * e > 3.1415926 Absolutely brilliant! That alone justifies including complex as a built- in type. *wi

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Martin Gregorie
On Sun, 20 Feb 2011 22:42:17 +1100, Ben Finney wrote: > Raymond Hettinger writes: > >> Compute π ± e by counting Mandlebrot set iterations :-) > > Very cool! I love π nerdery. > > > Raymond Hettinger writes: > >> > Compute ð ± e by counting Mandlebrot set iterations :-) >> >> That should be

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Ben Finney
Raymond Hettinger writes: > Compute π ± e by counting Mandlebrot set iterations :-) Very cool! I love π nerdery. Raymond Hettinger writes: > > Compute ð ± e by counting Mandlebrot set iterations :-) > > That should be: pi plus-or-minus e It was in my reader. Perhaps your server has encodin

Re: An amazing one-minute bit of fun at the interactive prompt

2011-02-20 Thread Raymond Hettinger
> Compute ð ± e by counting Mandlebrot set iterations :-) That should be: pi plus-or-minus e Raymond -- http://mail.python.org/mailman/listinfo/python-list