AggregateNumber
trait · ferroui-dynamic-data · v0.5.0
trait AggregateNumber: Copy + PartialEq + PartialOrd + Debug + 'static
A number that the aggregations add up and average (int, long, float, double).
Members
Average
type Average: Copy + PartialEq + PartialOrd + Debug + 'static
The type of an average: f64 for i32, i64 and f64 (double), f32 for f32
(float), as upstream's overloads of Avg return.
ZERO
const ZERO: Self
Zero, the sum of no values.
plus
fn plus(self: Self, other: Self) -> Self
self + other, wrapping on overflow for the integers.
minus
fn minus(self: Self, other: Self) -> Self
self - other, wrapping on overflow for the integers.
average
fn average(sum: Self, count: i32) -> <Self as >::Average
The average of count values (at least one) whose sum is sum: sum / (double)count for
the integers and double, sum / count in float for float.
to_average
fn to_average(self: Self) -> <Self as >::Average
The number as an average (the implicit conversion of upstream's emptyValue).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.