pub struct F101(/* private fields */);Expand description
A field element modulo 101.
§Examples
use field_cat::{F101, Field};
let a = F101::new(50);
let b = F101::new(30);
assert_eq!((a + b).value(), 80);
// Values larger than 101 are reduced.
assert_eq!(F101::new(103), F101::new(2));
// Multiplicative inverse via Fermat's little theorem.
let inv = F101::new(7).inv()?;
assert_eq!(F101::new(7) * inv, F101::one());Implementations§
Trait Implementations§
Source§impl FieldBytes for F101
impl FieldBytes for F101
impl Copy for F101
impl Eq for F101
impl StructuralPartialEq for F101
Auto Trait Implementations§
impl Freeze for F101
impl RefUnwindSafe for F101
impl Send for F101
impl Sync for F101
impl Unpin for F101
impl UnsafeUnpin for F101
impl UnwindSafe for F101
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more