pub trait MathBackend<T> {
Show 15 methods
// Required methods
fn sqrt(&self, x: T) -> T;
fn abs(&self, x: T) -> T;
fn min(&self, a: T, b: T) -> T;
fn max(&self, a: T, b: T) -> T;
fn floor(&self, x: T) -> T;
fn ceil(&self, x: T) -> T;
fn pow(&self, x: T, y: T) -> T;
fn ln(&self, x: T) -> T;
fn log10(&self, x: T) -> T;
fn sin(&self, x: T) -> T;
fn cos(&self, x: T) -> T;
fn tan(&self, x: T) -> T;
fn to_radians(&self, degrees: T) -> T;
fn to_degrees(&self, radians: T) -> T;
fn atan2(&self, y: T, x: T) -> T;
}Expand description
Backend trait that provides math operations for a specific numeric type
Required Methods§
Sourcefn to_radians(&self, degrees: T) -> T
fn to_radians(&self, degrees: T) -> T
Convert degrees to radians
Sourcefn to_degrees(&self, radians: T) -> T
fn to_degrees(&self, radians: T) -> T
Convert radians to degrees
Implementors§
impl MathBackend<f32> for FloatingPointBackend
Available on crate feature
floating-point only.impl MathBackend<i32> for IntegerBackend
Available on crate feature
integer-math only.