pub trait Real: RealByValue + for<'a> RealByValue<&'a Self> + Pi { }
Expand description

A general purpose extension to the numeric trait that adds many operations needed for more complex math operations.

This trait extends the constraints in RealByValue to types which also support the operations with a right hand side type by reference, and adds some additional constraints needed only by value on types.

When used together with RealRef this expresses all 4 by value and by reference combinations for the operations using the following syntax:

fn function_name<T: Numeric + Real>()
where for<'a> &'a T: NumericRef<T> + RealRef<T> {

}

This pair of constraints is used where any real number type is needed, so although this trait does not require reference type methods by itself, or re-require what is in Numeric, in practise you won’t be able to call many functions in this library with a real type that doesn’t.

Implementors

All types implemeting the operations in RealByValue with a right hand side type by reference are Real.

This covers primitives such as f32 & f64 as well as Traces and Records of those types.