simple_mod_int 0.1.0

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

example

use simple_mod_int::Mod;

let 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
let a/=b; // a = 14
println!("{:?}",a); // {value : 14, mod : 25 }
println!("{}",a.value); // 14