The modular-arithmetic package

[Tags: bsd3, library]

A convenient type for working with integers modulo some constant. It saves you from manually wrapping numeric operations all over the place and prevents a range of simple mistakes. Integer Mod 7 is the type of integers (mod 7) backed by Integer. We also have some cute syntax for these types like ℤ/7 for integers modulo 7.


[Skip to ReadMe]

Properties

Versions1.0.0.0, 1.0.0.1, 1.0.1.0, 1.0.1.1, 1.1.0.0, 1.2.0.0, 1.2.1.0, 1.2.1.1
Change logCHANGELOG.md
Dependenciesbase (>=4.7 && <5) [details]
LicenseBSD3
AuthorTikhon Jelvis <tikhon@jelv.is>
MaintainerTikhon Jelvis <tikhon@jelv.is>
CategoryMath
Home pagehttps://github.com/TikhonJelvis/modular-arithmetic
Bug trackerhttps://github.com/TikhonJelvis/modular-arithmetic/issues
Source repositoryhead: git clone git://github.com/TikhonJelvis/modular-arithmetic.git
UploadedFri May 1 00:09:06 UTC 2015 by TikhonJelvis
DistributionsNixOS:1.2.1.1
Downloads1155 total (72 in last 30 days)
Votes
1 []
StatusDocs available [build log]
Last success reported on 2015-05-01 [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for modular-arithmetic-1.2.1.1

Modular Arithmetic

Hackage package Build Status

This package provides a type for integers modulo some constant, usually written as ℤ/n.

Here is a quick example:

>>> 10 * 11 :: ℤ/7
5

It also works correctly with negative numeric literals:

>>> (-10) * 11 :: ℤ/7
2

Modular division is an inverse of modular multiplication. It is defined when divisor is coprime to modulus:

>>> 7 `div` 3 :: ℤ/16
13
>>> 3 * 13 :: ℤ/16
7