aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2019-04-29 10:23:19 +0100
committerGitHub <noreply@github.com>2019-04-29 10:23:19 +0100
commitd5fcf1edbb9259f913252753254b32ecb0ee2802 (patch)
treef34b6fa99a5a51685cacae7c6adf5359b34990db
parent139e5f886bf93b64f3485acb4fadf8c7f3254456 (diff)
parentcafb5ec400a92beb13c03ceb88e071b4d1bffdc2 (diff)
downloadperlweeklychallenge-club-d5fcf1edbb9259f913252753254b32ecb0ee2802.tar.gz
perlweeklychallenge-club-d5fcf1edbb9259f913252753254b32ecb0ee2802.tar.bz2
perlweeklychallenge-club-d5fcf1edbb9259f913252753254b32ecb0ee2802.zip
Merge pull request #106 from jmaslak/jmaslak-week6-2
Jmaslak week 6, problem 2
-rwxr-xr-xchallenge-006/joelle-maslak/perl5/ch-2.pl21
-rwxr-xr-xchallenge-006/joelle-maslak/perl6/ch-2.p617
2 files changed, 38 insertions, 0 deletions
diff --git a/challenge-006/joelle-maslak/perl5/ch-2.pl b/challenge-006/joelle-maslak/perl5/ch-2.pl
new file mode 100755
index 0000000000..b11ad31428
--- /dev/null
+++ b/challenge-006/joelle-maslak/perl5/ch-2.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+use v5.26;
+use strict;
+use warnings;
+
+use bignum;
+
+#
+# Copyright (C) 2019 Joelle Maslak
+# All Rights Reserved - See License
+#
+# I am assuming that we really wanted Ramanujan's Constant, and not the
+# linked to Wiki page on the Landau-Ramanujan Constant which is
+# something else entirely!
+#
+# Checked against http://oeis.org/A060295
+
+# We'll give *33* digits of precison, not 32. ;)
+# Formula is from the Wiki page. :) It's accurate to 33 digits.
+say substr(640320**3 + 744 - 196844/(640320**3 + 744), 0, 34);
+
diff --git a/challenge-006/joelle-maslak/perl6/ch-2.p6 b/challenge-006/joelle-maslak/perl6/ch-2.p6
new file mode 100755
index 0000000000..da44856b14
--- /dev/null
+++ b/challenge-006/joelle-maslak/perl6/ch-2.p6
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl6
+use v6;
+
+#
+# Copyright © 2019 Joelle Maslak
+# All Rights Reserved - See License
+#
+# I am assuming that we really wanted Ramanujan's Constant, and not the
+# linked to Wiki page on the Landau-Ramanujan Constant which is
+# something else entirely!
+#
+# Checked against http://oeis.org/A060295
+
+# We'll give *33* digits of precison, not 32. ;)
+# Formula is from the Wiki page. :) It's accurate to 33 digits.
+say (640320³ + 744 - 196844.FatRat/(640320³ + 744)).Str.substr(0,34);
+