Sure, because 9/9 = 1 and if you take x = 9^9^9, you get back (1 + x^(-1))^x, i.e. the first formula. It's cute, but I don't know if you could call it a "discovery".
Multiple ways to compute e in Raku
11–20 of 41 posts
Re: Multiple ways to compute e in Raku
#12This looks surprisingly neat, honestly. I've never used Perl, let alone Perl 6, but I think I see why people cared about it.
Is it officially appropriate to talk about Perl in the past tense?
What was Perl 6 will, moving forward, be known as "Raku".
Re: Multiple ways to compute e in Raku
#13[0]: https://stackoverflow.com/questions/30532471/firefox-redirec...
Re: Multiple ways to compute e in Raku
#14 >>> import math, timeit
>>> x = 2**52
>>> math.e
2.718281828459045
>>> (1+1/x)**x
2.718281828459045
>>> timeit.timeit(lambda: (1+1/x)**x, number = 10**6) / 10**6
2.1324560802895575e-07
>>> timeit.timeit(lambda: (1+1/x)**float(x), number = 10**6) / 10**6
3.0082468304317444e-07
>>> from mpmath import mp
>>> mp.dps = 1000
>>> (1+1/mp.mpf(x))**x
mpf(‘2.7182818284590449335703801338125114…’)
>>> timeit.timeit(lambda: (1+1/mp.mpf(x))**x, number = 10**3) / 10**3
0.0004724335519131273
>>> timeit.timeit(lambda: (1+1/mp.mpf(x))**mp.mpf(x), number = 10**3) / 10**3
0.00047394841397181155
(Times in seconds.)Re: Multiple ways to compute e in Raku
#15This article is a love letter to both mathematics and programming. It is awesome to read something and grasp the joy and playfulness of the author. The maths are explained in a simple way. The programming concepts go from the straightforward to the delightfully weird (and let't not kid ourselves, Raku shines the most the weirder things get). And the final result is downright fun. I love it.
Re: Multiple ways to compute e in Raku
#16Re: Multiple ways to compute e in Raku
#17This looks surprisingly neat, honestly. I've never used Perl, let alone Perl 6, but I think I see why people cared about it.
Is it officially appropriate to talk about Perl in the past tense?
Re: Multiple ways to compute e in Raku
#18Earlier quoted context omitted.
Is it officially appropriate to talk about Perl in the past tense?
Perl 5 will continue to be the official "Perl". Development on that continues, and it has an extensive community, though not nearly as large as Python, which was once its peer. What was Perl 6 will, moving forward, be known as "Raku".
Re: Multiple ways to compute e in Raku
#19I can't connect to this page, as Firefox is automatically redirecting me to the HTTPS version of the page even though it's not supported. I guess I don't run into this that often given how common HTTPS is, but maybe someone else has this problem with this site? If you are, have you fixed it before? I've tried all of the methods mentioned on this[0] page, and I'm on Firefox 70 on Linux Mint. [0]: https://stackoverflow…
You sure you don't have HTTPS-Everywhere or something similar running?
(There's noting in the response headers or html meta tags that look like it'd be redirecting you too https there...)
Re: Multiple ways to compute e in Raku
#20Raku = Perl 6, just in case you're wondering.
More like "Raku (nee Perl6)" I think.
It's (now) called Raku, because it isn't really Perl any more - even though it started out that way. "Perl" is Perl 5 now.