pub struct Fp(pub i32);
Expand description
A fixed-point number with 16.16 format.
Tuple Fields§
§0: i32
Implementations§
source§impl Fp
impl Fp
pub const SCALE: i32 = 65_536i32
pub const SCALE_I64: i64 = 65_536i64
pub const FSCALE: f32 = 65536f32
pub const FRAC_PI_2: Fp = _
pub const PI: Fp = _
pub const TAU: Fp = _
sourcepub fn neg_one() -> Self
pub fn neg_one() -> Self
Returns the constant Fp
value for negative one.
§Examples
use fixed32::Fp;
assert_eq!(<Fp as Into<i16>>::into(Fp::neg_one()), -1);
sourcepub fn zero() -> Self
pub fn zero() -> Self
Returns the constant Fp
value for zero.
§Examples
use fixed32::Fp;
assert_eq!(<Fp as Into<i16>>::into(Fp::zero()), 0);
pub fn normalize(self) -> Self
pub fn ceil(self) -> Self
pub fn round(self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
pub fn sin(self) -> Self
pub fn asin(self) -> Self
pub fn cos(self) -> Self
pub fn acos(self) -> Self
pub fn abs(self) -> Self
pub fn sqrt(self) -> Self
pub const MIN: Fp = _
pub const MAX: Fp = _
Trait Implementations§
source§impl AddAssign for Fp
impl AddAssign for Fp
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl Ord for Fp
impl Ord for Fp
source§impl PartialOrd for Fp
impl PartialOrd for Fp
source§impl SubAssign for Fp
impl SubAssign for Fp
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl Copy for Fp
impl Eq for Fp
impl StructuralPartialEq for Fp
Auto Trait Implementations§
impl Freeze for Fp
impl RefUnwindSafe for Fp
impl Send for Fp
impl Sync for Fp
impl Unpin for Fp
impl UnwindSafe for Fp
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)