Classify

Trait Classify 

Source
pub trait Classify {
    // Required method
    fn kernel_classify(&self) -> FpCategory;
}

Required Methods§

Source

fn kernel_classify(&self) -> FpCategory

Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.

use num_valid::functions::Classify;
use std::num::FpCategory;

let num = 12.4_f64;
let inf = f64::INFINITY;

assert_eq!(num.kernel_classify(), FpCategory::Normal);
assert_eq!(inf.kernel_classify(), FpCategory::Infinite);

Implementations on Foreign Types§

Source§

impl Classify for f64

Source§

fn kernel_classify(&self) -> FpCategory

Returns the floating point category of the number. If only one property is going to be tested, it is generally faster to use the specific predicate instead.

use num_valid::functions::Classify;
use std::num::FpCategory;

let num = 12.4_f64;
let inf = f64::INFINITY;

assert_eq!(num.kernel_classify(), FpCategory::Normal);
assert_eq!(inf.kernel_classify(), FpCategory::Infinite);

Implementors§