The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Language::Befunge::lib::MODU - Modulo Arithmetic extension

VERSION

version 5.000

DESCRIPTION

The MODU fingerprint (0x4d4f4455) implements some of the finer, less-well- agreed-upon points of modulo arithmetic. With positive arguments, these instructions work exactly the same as % does. However, when negative values are involved, they all work differently.

FUNCTIONS

new

Create a new MODU instance.

Modulo implementations

$mod = M( $x, $y )

Signed-result modulo: x MOD y = x - FLOOR(x / y) * y

$mod = U( $x, $y )

Sam Holden's unsigned-result modulo... No idea who this Sam Holden is or if he has a special algorithm for this, therefore always returning absolute value of standard modulo.

$mod = R( $x, $y )

C-language integer remainder: old C leaves negative modulo undefined but C99 defines it as the same sign as the dividend so that's what we're going with.

SEE ALSO

http://catseye.tc/projects/funge98/library/MODU.html.

AUTHOR

Jerome Quelin

COPYRIGHT AND LICENSE

This software is copyright (c) 2003 by Jerome Quelin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.