Root

Trait Root 

Source
pub trait Root: TruncRoot {
    // Required methods
    fn sqrt(self) -> Self;
    fn cbrt(self) -> Self;
}
Expand description

Trait for sqrt and cbrt methods, which compute the square root and cube root of a number.

For non-numbers types (number-containers like Vec2) the logic of sqrt / cbrt should follow the logic of Mul. For example, if <Vec2 as Mul> multiplies each component seperately, should also sqrt each component seperately.

Required Methods§

Source

fn sqrt(self) -> Self

Source

fn cbrt(self) -> Self

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 Root for f32

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

impl Root for f64

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Implementors§