``````package Math::ModInt::Trivial;

use 5.006;
use strict;
use warnings;

# ----- object definition -----

# Math::ModInt::Trivial=ARRAY(...)

# .......... index ..........   # .......... value ..........
use constant NFIELDS   => 0;

# ----- class data -----

BEGIN {
require Math::ModInt;
our @ISA     = qw(Math::ModInt);
our \$VERSION = '0.013';
}

*signed_residue   =
*centered_residue = \&residue;

my \$singleton = bless [];

# ----- overridden methods -----

sub _NEG { \$singleton }
sub _SUB { \$singleton }
sub _MUL { \$singleton }
sub _DIV { \$singleton }
sub _POW { \$singleton }
sub _INV { \$singleton }
sub _NEW { \$singleton }
sub _NEW2 { (\$_, \$singleton) }

sub modulus { 1 }
sub residue { 0 }

1;

__END__

Math::ModInt::Trivial - integer arithmetic modulo one

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

use Math::ModInt qw(mod);

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

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

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

Math::ModInt::Trivial is an implementation of Math::ModInt for
modulus one.  Like all Math::ModInt implementations, it is loaded
behind the scenes when there is demand for it, without applications

The residue class modulo one is the only ring where division by
zero is defined, because the single element is its own multiplicative
inverse.  While operating on a one-element space may seem rather
pointless, modular arithmetic would be incomplete without it, as
it is a valid quotient ring of the ring of integers.

=over 4

=item *

L<Math::ModInt>

=item *

The subject "trivial ring" on Wikipedia.
L<http://en.wikipedia.org/wiki/Trivial_ring>

=back

Martin Becker, E<lt>becker-cpan-mp I<at> cozap.comE<gt>

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

This library is free software; you can distribute it and/or modify it
{"ft_lang_label":"__label__en","ft_lang_prob":0.5991765,"math_prob":0.8927982,"size":2348,"snap":"2022-05-2022-21","text_gpt3_token_len":672,"char_repetition_ratio":0.16040955,"word_repetition_ratio":0.0,"special_character_ratio":0.3326235,"punctuation_ratio":0.2602459,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9948171,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-18T07:34:32Z\",\"WARC-Record-ID\":\"<urn:uuid:b0ff15ec-00cc-4da4-af1b-2e9285f3c72d>\",\"Content-Length\":\"18479\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4c0d1241-f323-4d25-b237-5b4daa389a6a>\",\"WARC-Concurrent-To\":\"<urn:uuid:452e0d6b-be3c-418e-ba1f-cfecb8f094c6>\",\"WARC-IP-Address\":\"151.101.130.217\",\"WARC-Target-URI\":\"https://metacpan.org/release/MHASCH/Math-ModInt-0.013/source/lib/Math/ModInt/Trivial.pm\",\"WARC-Payload-Digest\":\"sha1:UIWGGHY2QRQU5GKZP4ELIK55HCIMXOCC\",\"WARC-Block-Digest\":\"sha1:WK6CDOA3UOCEINLLTFJS2O4M2WAPIXIY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662521152.22_warc_CC-MAIN-20220518052503-20220518082503-00506.warc.gz\"}"}