diff options
| -rw-r--r-- | challenge-106/abigail/README.md | 7 | ||||
| -rw-r--r-- | challenge-106/abigail/awk/ch-1.gawk | 2 | ||||
| -rw-r--r-- | challenge-106/abigail/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-106/abigail/blog1.txt | 1 | ||||
| -rw-r--r-- | challenge-106/abigail/perl/ch-2.pl | 6 |
5 files changed, 13 insertions, 4 deletions
diff --git a/challenge-106/abigail/README.md b/challenge-106/abigail/README.md index 2125b781ac..3b4bc6fcf4 100644 --- a/challenge-106/abigail/README.md +++ b/challenge-106/abigail/README.md @@ -31,7 +31,7 @@ Output: 0 * [Ruby](ruby/ch-1.rb) ### Blog -[]() +[Perl Weekly Challenge 106: Maximum Gap](https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-106-1.html) ## [Decimal String](https://perlweeklychallenge.org/blog/perl-weekly-challenge-106/#TASK2) @@ -54,6 +54,9 @@ Output: "0.0(75)" ### Notes +We are assuming the numerator is non-negative, and the denominator +is positive. Dealing with signs is left as an exercise to the reader. + We're creation the decimal expansion of the fraction `$N / $D` by performing long division. @@ -102,4 +105,4 @@ Wikipedia](https://en.wikipedia.org/wiki/Repeating_decimal). * [Ruby](ruby/ch-2.rb) ### Blog -[]() +[Perl Weekly Challenge 106: Decimal String](https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-106-2.html) diff --git a/challenge-106/abigail/awk/ch-1.gawk b/challenge-106/abigail/awk/ch-1.gawk index ad08cdc38a..97f2f8e3ce 100644 --- a/challenge-106/abigail/awk/ch-1.gawk +++ b/challenge-106/abigail/awk/ch-1.gawk @@ -23,7 +23,7 @@ } # - # Sor the array; for numeric values, this sorts numerically. + # Sort the array; for numeric values, this sorts numerically. # asort(N) diff --git a/challenge-106/abigail/blog.txt b/challenge-106/abigail/blog.txt new file mode 100644 index 0000000000..c7419cfd89 --- /dev/null +++ b/challenge-106/abigail/blog.txt @@ -0,0 +1 @@ +https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-106-1.html diff --git a/challenge-106/abigail/blog1.txt b/challenge-106/abigail/blog1.txt new file mode 100644 index 0000000000..14de388cf2 --- /dev/null +++ b/challenge-106/abigail/blog1.txt @@ -0,0 +1 @@ +https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-106-2.html diff --git a/challenge-106/abigail/perl/ch-2.pl b/challenge-106/abigail/perl/ch-2.pl index f53e393e9e..a5857147eb 100644 --- a/challenge-106/abigail/perl/ch-2.pl +++ b/challenge-106/abigail/perl/ch-2.pl @@ -18,6 +18,11 @@ use experimental 'lexical_subs'; # # +# We are assuming the input consists of pairs of non-negative +# integers, with the denominator greater than 0. +# + +# # To determine the repeating digits of a fraction, it's very tempting # to use sprintf with a large amount of digits, and see what repeats. # But Perl isn't precise enough even for small numbers to do so. @@ -33,7 +38,6 @@ use experimental 'lexical_subs'; # after the 70th, are 0. # - # # We're creation the decimal expansion of the fraction $N / $D # by performing long division. |
