Arithmetic-PaperAndPencil

 view release on metacpan or  search on metacpan

doc/documentation.en.md  view on Meta::CPAN

      for my $line (@sheet) {
        unshift @$line, (Arithmetic::PaperAndPencil::Char->space_char) x $delta_c;
      }
```

It   did  not   work.  Test   programme  `01-action.t`   (Raku-to-Perl
translation  of  `06-html.rakutest`) would  write  `133`  where I  was
expecting  `123`. After  some debugging,  I understood  that one  each
line,  the `unshift`  statement would  insert the  same `A::P&P::Char`
instance twice.  On the other hand,  the problem was not  appearing in
Raku. Either  formula `space-char() xx $delta-c`  calls twice function
`space-char` and  gets two  different instances of  `A::P&P::Char`, or
the `prepend` statement deep-copies its argument into the list. Either
way, I had to fix the Perl version and write:

```
      # Perl
      for my $line (@sheet) {
        for (1 .. $delta_c) {
          unshift @$line, Arithmetic::PaperAndPencil::Char->space_char;
        }

lib/Arithmetic/PaperAndPencil.pm  view on Meta::CPAN

amended,  such as  a  multiplication where  the  multiplicand and  the
multiplier contain many  "0" digits. The module does  not detect these
cases and still uses the unaltered computation procedure.

Human beings write their calculations on A4 paper (21 cm × 29,7 cm) or
letter paper (21,6  cm × 27,9 cm). The module  writes its calculations
on unlimited  sheets of paper. If  you want to compute  the product of
two 1000-digit numbers, the multiplication will have a 2000-char width
and a 1000-line height and still be on a single sheet of paper.

If you  ask for the  operations with  the "talking" formulas,  most of
these  formulas are  the traditional  sentences which  accompanies the
writing of the  computation. But in some cases, the  module displays a
non-standard sentence, to explain better what is happening.

=head1 EXPORT

None.

=head1 UTILITY METHODS

=head2 new



( run in 0.876 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )