pub trait PyMod<Rhs = Self> { type Output; // Required method fn pymod(&self, rhs: Rhs) -> Self::Output; }
The PyMod trait, inpired by pythons % operator, describes a method for finding the modulo between two numbers which, rather uniquely, preserves the sign of the denominator.
PyMod
%
use rstmt_core::PyMod; let m = 12; assert_eq!(22.pymod(m), 10); assert_eq!(-17.pymod(m), -5);