Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Math::NoCarry 1.10

    Download button

    No screenshots available
    Downloads: 289  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.2/5)
    5 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    brian d foy | More programs
    Perl Artistic License / FREE
    August 9th, 2007, 04:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Math::NoCarry description

    Math::NoCarry is a Perl extension for no carry arithmetic.

    Math::NoCarry is a Perl extension for no carry arithmetic.

    SYNOPSIS

    use Math::NoCarry;

    my $sum = Math::NoCarry::add( 123, 456 );

    my $difference = Math::NoCarry::subtract( 123, 456 );

    my $product = Math::NoCarry::multiply( 123, 456 );

    No carry arithmetic doesn't allow you to carry digits to the next column. For example, if you add 8 and 4, you normally expect the answer to be 12, but that 1 digit is a carry. In no carry arithmetic you can't do that, so the sum of 8 and 4 is just 2. In effect, this is addition modulo 10 in each column. I discard all of the carry digits in this example:

    1234
    + 5678
    ------
    6802

    For multiplication, the result of pair-wise multiplication of digits is the modulo 10 value of their normal, everyday multiplication.

    123
    x 456
    -----
    8 6 x 3
    2 6 x 2
    6 6 x 1

    5 5 x 3
    0 5 x 2
    5 5 x 1

    2 4 x 3
    8 4 x 2
    + 4 4 x 1
    -------
    43878
    Since multiplication and subtraction are actually types of additions, you can multiply and subtract like this as well.

    No carry arithmetic is both associative and commutative.

    Requirements:

    · Perl



    Product's homepage

      


    TAGS:

    no carry arithmetic | Perl extension | Perl module | NoCarry | arithmetic | mathematical

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM