pub trait Float:
NumTraitsFloat
+ From<u16>
+ Default
+ Copy {
Show 14 associated constants and 6 methods
const ZERO: Self;
const ONE: Self;
const TWO: Self;
const THREE: Self;
const ONE_HALF: Self;
const POINT_ONE: Self;
const POINT_NINE_EIGHT: Self;
const RES_MAX: Self;
const NOTE_MAX: Self;
const SHAPE_CLIP: Self;
const FRAC_2_PI: Self;
const FRAC_PI_2: Self;
const PI: Self;
const TAU: Self;
// Required methods
fn fsin(self) -> Self;
fn fcos(self) -> Self;
fn ftan(self) -> Self;
fn midi_to_freq(self) -> Self;
fn as_f32(self) -> f32;
// Provided method
fn from_u16(x: u16) -> Self { ... }
}Expand description
Types must implement this trait to instantiate any of the generic devices
in this module. Implementations are provided for f32 and f64.
Required Associated Constants§
Sourceconst POINT_NINE_EIGHT: Self
const POINT_NINE_EIGHT: Self
0.98
Sourceconst SHAPE_CLIP: Self
const SHAPE_CLIP: Self
0.9375
Required Methods§
Sourcefn midi_to_freq(self) -> Self
fn midi_to_freq(self) -> Self
Convert a MIDI note number to a frequency
Provided Methods§
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.