The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Math::ModInt::GF2 - integer arithmetic modulo 2

VERSION

This documentation refers to version 0.013 of Math::ModInt::GF2.

SYNOPSIS

  use Math::ModInt;

  $a = Math::ModInt->new(1, 2);                   # 1 [mod 2]
  $b = $a->new(0);                                # 0 [mod 2]
  $c = $a + $b;                                   # 1 [mod 2]
  $d = $a**2 - $b/$a;                             # 1 [mod 2]

  print $d->residue, " [mod ", $b->modulus, "]";  # prints 1 [mod 2]
  print "$d";                                     # prints mod(1, 2)

  $bool = $c == $d;                               # true

DESCRIPTION

Math::ModInt::GF2 is an implementation of Math::ModInt for modulus two. Like all Math::ModInt implementations, it is loaded behind the scenes when there is demand for it, without applications needing to worry about it. Implementations for special cases like this can take advantage of properties specific to their subdomain and be therefore substantially more efficient than generic ones.

SEE ALSO

AUTHOR

Martin Becker, <becker-cpan-mp at cozap.com>

LICENSE AND COPYRIGHT

Copyright (c) 2009-2021 Martin Becker, Blaubeuren.

This library is free software; you can distribute it and/or modify it under the terms of the Artistic License 2.0 (see LICENSE file).

DISCLAIMER OF WARRANTY

This library is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.