Arithmetic::PaperAndPencil

Simulating paper-and-pencil techniques for basic arithmetic operations

NAME

Arithmetic::PaperAndPencil - simulating paper and pencil techniques for basic arithmetic operations

SYNOPSIS

use Arithmetic::PaperAndPencil;

my Arithmetic::PaperAndPencil $paper-sheet .= new;
my Arithmetic::PaperAndPencil::Number $x .= new(value => '355000000');
my Arithmetic::PaperAndPencil::Number $y .= new(value => '113');

$paper-sheet.division(dividend => $x, divisor => $y);
my Str $html = $paper-sheet.html(lang => 'fr', silent => False, level => 3);
'division.html'.IO.spurt($html);

$paper-sheet .= new; # emptying previous content
my Arithmetic::PaperAndPencil::Number $dead .= new(value => 'DEAD', radix => 16);
my Arithmetic::PaperAndPencil::Number $beef .= new(value => 'BEEF', radix => 16);

$paper-sheet.addition($dead, $beef);
$html = $paper-sheet.html(lang => 'fr', silent => False, level => 3);
'addition.html'.IO.spurt($html);

The first HTML file ends with

 355000000|113
 0160     |---
  0470    |3141592
   0180   |
    0670  |
     1050 |
      0330|
       104|

and the second one with

  DEAD
  BEEF
 -----
 19D9C

DESCRIPTION

Arithmetic::PaperAndPencil is a module which allows simulating the paper and pencil techniques for basic arithmetic operations on integers: addition, subtraction, multiplication and division, but also square root extraction and conversion from a radix to another.

PATCHES WELCOME

When rendering an operation as HTML, the module displays spoken French sentences. If you know the equivalent sentences in another language, you can contact me to add the other language to the distribution, or you can even send me a patch. Thank you in advance.

AUTHOR

Jean Forget [email protected]

DEDICATION

This module is dedicated to my primary school teachers, who taught me the basics of arithmetics, and even some advanced features, and to my secondary school math teachers, who taught me other advanced math concepts and features.

COPYRIGHT AND LICENSE

Copyright 2023, 2024 Jean Forget

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Arithmetic::PaperAndPencil v0.0.1

Simulating paper-and-pencil techniques for basic arithmetic operations

Authors

  • Jean Forget

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Arithmetic::PaperAndPencil
  • Arithmetic::PaperAndPencil::Action
  • Arithmetic::PaperAndPencil::Char
  • Arithmetic::PaperAndPencil::Label
  • Arithmetic::PaperAndPencil::Number

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.