Trait tea_dtype::Number

source ·
pub trait Number:
    Copy
    + Send
    + Sync
    + IsNone
    + Sized
    + Default
    + Num
    + AddAssign
    + SubAssign
    + MulAssign
    + DivAssign
    + PartialOrd
    + MulAdd
    + Cast<f64>
    + Cast<f32>
    + Cast<usize>
    + Cast<i32>
    + Cast<i64>
    + 'static {
Show 17 methods // Required methods fn min_() -> Self; fn max_() -> Self; fn abs(self) -> Self; // Provided methods fn ceil(self) -> Self { ... } fn floor(self) -> Self { ... } fn min_with(self, other: Self) -> Self { ... } fn max_with(self, other: Self) -> Self { ... } fn f32(self) -> f32 { ... } fn f64(self) -> f64 { ... } fn i32(self) -> i32 { ... } fn i64(self) -> i64 { ... } fn usize(self) -> usize { ... } fn fromas<U>(v: U) -> Self where U: Number + Cast<Self>, Self: 'static { ... } fn to<T: Number>(self) -> T where Self: Cast<T> { ... } fn kh_sum(self, v: Self, c: &mut Self) -> Self { ... } fn n_add(self, other: Self, n: &mut usize) -> Self { ... } fn n_prod(self, other: Self, n: &mut usize) -> Self { ... }
}

Required Methods§

source

fn min_() -> Self

return the min value of the data type

source

fn max_() -> Self

return the max value of the data type

source

fn abs(self) -> Self

Provided Methods§

source

fn ceil(self) -> Self

source

fn floor(self) -> Self

source

fn min_with(self, other: Self) -> Self

source

fn max_with(self, other: Self) -> Self

source

fn f32(self) -> f32

source

fn f64(self) -> f64

source

fn i32(self) -> i32

source

fn i64(self) -> i64

source

fn usize(self) -> usize

source

fn fromas<U>(v: U) -> Self
where U: Number + Cast<Self>, Self: 'static,

create a value of type T using a value of type U using Cast

source

fn to<T: Number>(self) -> T
where Self: Cast<T>,

cast self to another dtype using Cast

source

fn kh_sum(self, v: Self, c: &mut Self) -> Self

source

fn n_add(self, other: Self, n: &mut usize) -> Self

if other is nan, then add other to self and n += 1 else just return self

source

fn n_prod(self, other: Self, n: &mut usize) -> Self

if other is nan, then product other to self and n += 1 else just return self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Number for f32

source§

fn min_() -> f32

source§

fn max_() -> f32

source§

fn ceil(self) -> Self

source§

fn floor(self) -> Self

source§

fn abs(self) -> Self

source§

impl Number for f64

source§

fn min_() -> f64

source§

fn max_() -> f64

source§

fn ceil(self) -> Self

source§

fn floor(self) -> Self

source§

fn abs(self) -> Self

source§

impl Number for i32

source§

fn min_() -> i32

source§

fn max_() -> i32

source§

fn abs(self) -> Self

source§

impl Number for i64

source§

fn min_() -> i64

source§

fn max_() -> i64

source§

fn abs(self) -> Self

source§

impl Number for u64

source§

fn min_() -> u64

source§

fn max_() -> u64

source§

fn abs(self) -> Self

source§

impl Number for usize

source§

fn min_() -> usize

source§

fn max_() -> usize

source§

fn abs(self) -> Self

Implementors§