diff options
| author | Tim Smith <tim.dolores@gmail.com> | 2019-04-30 23:16:37 -0400 |
|---|---|---|
| committer | Tim Smith <tim.dolores@gmail.com> | 2019-04-30 23:55:36 -0400 |
| commit | 0c63db48073745086426393038efc5cb49f28435 (patch) | |
| tree | 1abde023e0d8c427218274b35611293a50922425 | |
| parent | db975fdc5292458acb5277082fb21c9faeeedeb5 (diff) | |
| download | perlweeklychallenge-club-0c63db48073745086426393038efc5cb49f28435.tar.gz perlweeklychallenge-club-0c63db48073745086426393038efc5cb49f28435.tar.bz2 perlweeklychallenge-club-0c63db48073745086426393038efc5cb49f28435.zip | |
Add tim-smith/perl6/ch-2.p6
| -rwxr-xr-x | challenge-006/tim-smith/perl6/ch-2.p6 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-006/tim-smith/perl6/ch-2.p6 b/challenge-006/tim-smith/perl6/ch-2.p6 new file mode 100755 index 0000000000..73a74698c2 --- /dev/null +++ b/challenge-006/tim-smith/perl6/ch-2.p6 @@ -0,0 +1,12 @@ +#! /usr/bin/env perl6 + +# https://en.wikipedia.org/wiki/Heegner_number#Almost_integers_and_Ramanujan's_constant + +# Ramanujan's constant is _almost_ this integer ... +my $r = 640_320 ** 3 + 744; + +# But is off by an error which is defined in terms of the constant itself, +# so this approximation is close enough for at least 32 significant digits. +$r += FatRat.new: -196_844, $r; + +put substr($r, 0, 33); |
