Trait geo_nd::Float

source ·
pub trait Float: Num + Float {
    // Provided methods
    fn int(n: isize) -> Self { ... }
    fn frac(n: isize, d: usize) -> Self { ... }
    fn pi() -> Self { ... }
}
Expand description

The Float trait is required for matrix or vector elements which have a float aspect, such as sqrt.

The trait is essentially num_traits::Float, but it supplies implicit methods for construction of a Float from an isize value, or as a rational from a pair of isize values.

As num_traits::Float includes num_traits::NumCast it is not possible to require, as would perhaps be desired, a From trait, without conflicts occurring.

Provided Methods§

source

fn int(n: isize) -> Self

Create a Float from an isize value; this should support constant implementations with no run-time overhead.

source

fn frac(n: isize, d: usize) -> Self

Create a Float as a fraction described by a numerator and denomiator pair of isize values; this should support constant implementations with no run-time overhead.

source

fn pi() -> Self

Return the value of PI

Implementations on Foreign Types§

source§

impl Float for f64

source§

fn pi() -> Self

source§

impl Float for f32

source§

fn pi() -> Self

Implementors§