2 releases

Uses old Rust 2015

0.1.1 Dec 30, 2017
0.1.0 Dec 30, 2017

#15 in #modular-arithmetic

40 downloads per month

MIT license

8KB
202 lines

modint

Modular arithmetic integer type

Example

use typenum::U17;

type M17 = Unsigned<u8, U17>;

assert_eq!(M17::from(16) + 14.into(), 13.into());
assert_eq!(M17::from(11) - 15.into(), 13.into());
assert_eq!(M17::from(11) * 15.into(), 12.into());
assert_eq!(M17::from(13) / 4 .into(),  3.into());

Dependencies

~400KB