AddOrdered

Trait AddOrdered 

Source
pub trait AddOrdered: PartialOrd { }
Expand description

A marker trait signifying that for x > y, x+z > x+z and z+x > z+x for all z

Note that for monoids with some negative or positive element x this automatically means that the magma is infinite, as otherwise, there would be a maximum element M and minimum m, contradicting M + x > M + 0 = M (if x > 0) or m + x < m + 0 = m (if x < 0). (Of course, the bitwise representations of these structures size limited by size, but in practice, we treat them as infinite anyway.)

Futhermore, for monoids and groups, this provides a way to embed the Naturals and Integers into the structure respectively, and if the structure also is an ordered semiring with one, then there is even a canonical embedding following both addition and multiplication rules

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AddOrdered for f32

Source§

impl AddOrdered for f64

Source§

impl AddOrdered for i8

Source§

impl AddOrdered for i16

Source§

impl AddOrdered for i32

Source§

impl AddOrdered for i64

Source§

impl AddOrdered for i128

Source§

impl AddOrdered for isize

Source§

impl AddOrdered for u8

Source§

impl AddOrdered for u16

Source§

impl AddOrdered for u32

Source§

impl AddOrdered for u64

Source§

impl AddOrdered for u128

Source§

impl AddOrdered for usize

Implementors§