simple_mod_int 0.1.2

A simple modint library
Documentation
  • Coverage
  • 50%
    3 out of 6 items documented2 out of 3 items with examples
  • Size
  • Source code size: 16.54 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • misty1999/simple_mod_int
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • misty1999

example

use simple_mod_int::Mod;

let mut a: Mod<25> = 7.into();
let b: Mod<25> = 13.into();

let sum = a + b;  // 20
let product = a * b;  // 16
let power = a.pow(3);  // 18
let inv = a.inv();  // 18
let power_neg = a.pow(-3);  // 7
let div = a / b;  // 14
a /= b; // a = 14
a += 10; // a = 7
println!("{:?}",a); // {value : 7, mod : 25 }
println!("{}",a.value); // 7