Arithmetic-PaperAndPencil

 view release on metacpan or  search on metacpan

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

written below this  line. As the first partial  remainder is computed,
the  used digits  of the  dividend and  divisor are  stricken and  the
digits of  the partial remainder are  written above the digits  of the
dividend. When computing the next digits, the divisor is rewritten and
the computation of the next partial remainder again strikes the digits
of the  first partial remainder  and of  the second occurrence  of the
divider.

Acceptable  break  from   reality:  I  have  not   found  anywhere  an
explanation for this technique. The way it is implemented is just some
guesswork after some reverse engineering  attempt on a few examples. A
special point  is that it  seems to  require something similar  to the
C<cheating>  technique  above,  because  I  do  not  see  how  we  can
"unstrike"  the digits  that  were stricken  with  the previous  digit
candidate.

=back

=head2 square_root

Simulates the  extraction of the square  root of a number.  There is a

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

               , 'TIT10' => 'Division of #1# by #2#, with cheating, radix #3#'
               , 'TIT11' => 'Division of #1# by #2#, with preparation, radix #3#'
               , 'TIT12' => 'Division of #1# by #2#, "boat" processus, radix #3#'
               , 'TIT13' => 'Square root of #1#, radix #2#'
               , 'TIT14' => 'Conversion of #1#, radix #2# to radix #3#, cascading multiplications (Horner scheme)'
               , 'TIT15' => 'Subtraction of #1# and #2# by adding the #3#-complement)'
               , 'TIT16' => 'Conversion of #1#, radix #2# to radix #3#, cascading divisions'
               , 'TIT17' => 'GCD of #1# and #2#, radix #3#'
               , 'TIT18' => 'GCD of #1# and #2#, radix #3#, cheating'
               , 'TIT19' => 'Multiplication of #1# and #2#, "Russian peasant" processus, radix #3#'
               , 'MUL01' => '#1# times #2#, #3#'    # guesswork
               }
               )
               ;

our sub full_label($label, $val1, $val2, $val3, $ln) {
  my $result;
  if ($label{$ln}{$label}) {
    $result = $label{$ln}{$label};
  }
  else {



( run in 0.343 second using v1.01-cache-2.11-cpan-702932259ff )