From 4b461cb77f2cdb22c43130398dcbc65cbc6ac996 Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 4 Apr 2021 15:51:00 +0200 Subject: Remark we are not dealing with negative numbers in the input --- challenge-106/abigail/README.md | 3 +++ challenge-106/abigail/perl/ch-2.pl | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/challenge-106/abigail/README.md b/challenge-106/abigail/README.md index 493e730736..38eaa65584 100644 --- a/challenge-106/abigail/README.md +++ b/challenge-106/abigail/README.md @@ -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. 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 @@ -17,6 +17,11 @@ use experimental 'lexical_subs'; # Run as: perl ch-2.pl < input-file # +# +# 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. @@ -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. -- cgit