Skip to main content

Transcendental

Trait Transcendental 

Source
pub trait Transcendental: Scalar {
    const PI: Self;

    // Required methods
    fn to_f32(self) -> f32;
    fn from_f32(value: f32) -> Self;
    fn sqrt(self) -> Self;
    fn exp(self) -> Self;
    fn ln(self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn tan(self) -> Self;

    // Provided methods
    fn to_f64(self) -> f64 { ... }
    fn from_f64(value: f64) -> Self { ... }
}
Expand description

Трансцендентные операции (sin, cos, sqrt, exp, ln).

Расширяет Scalar функциями, доступными только для типов с плавающей точкой (f32, f64).

Required Associated Constants§

Source

const PI: Self

Required Methods§

Source

fn to_f32(self) -> f32

Source

fn from_f32(value: f32) -> Self

Source

fn sqrt(self) -> Self

Source

fn exp(self) -> Self

Source

fn ln(self) -> Self

Source

fn sin(self) -> Self

Source

fn cos(self) -> Self

Source

fn tan(self) -> Self

Provided Methods§

Source

fn to_f64(self) -> f64

Source

fn from_f64(value: f64) -> 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 Transcendental for f32

Source§

const PI: f32 = std::f32::consts::PI

Source§

fn to_f32(self) -> f32

Source§

fn from_f32(value: f32) -> f32

Source§

fn from_f64(value: f64) -> f32

Source§

fn sqrt(self) -> f32

Source§

fn exp(self) -> f32

Source§

fn ln(self) -> f32

Source§

fn sin(self) -> f32

Source§

fn cos(self) -> f32

Source§

fn tan(self) -> f32

Source§

impl Transcendental for f64

Source§

const PI: f64 = std::f64::consts::PI

Source§

fn to_f32(self) -> f32

Source§

fn from_f32(value: f32) -> f64

Source§

fn from_f64(value: f64) -> f64

Source§

fn sqrt(self) -> f64

Source§

fn exp(self) -> f64

Source§

fn ln(self) -> f64

Source§

fn sin(self) -> f64

Source§

fn cos(self) -> f64

Source§

fn tan(self) -> f64

Implementors§