Trait tallystick::Numeric [−][src]
Expand description
A trait for numeric types used to count votes.
Generally seen as the generic C
in this codebase, this type should be automatically implemented for all numeric types you wish to use.
It is used to provide trait specialization so differnetial logic can applied to integer or fractional (float) based vote counting.
You should pobably not implement this trait. If you have a numeric type that does not implement Numeric
,
you should instead implement num_traits::Num
(and optionally num_traits::real::Real
for types that support fractions.)
Required methods
Get the floor for this numeric type. For non-fractional types, this just returns self.
Does this numeric type support fractional values? Integer-based types will return false. Float, or num_rational::Ratio based types should return true.