pub struct Number(pub i32);
Expand description
Fixed-width numeric type used in TFM files.
This numeric type has 11 bits for the integer part,
20 bits for the fractional part, and a single signed bit.
The inner value is the number multiplied by 2^20.
It is called a fix_word
in TFtoPL.
In property list files, this type is represented as a decimal number with up to 6 digits after the decimal point. This is a non-lossy representation because 10^(-6) is larger than 2^(-20).
Tuple Fields§
§0: i32
Implementations§
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Number
impl<'arbitrary> Arbitrary<'arbitrary> for Number
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moresource§impl From<Number> for DesignSize
impl From<Number> for DesignSize
source§impl Ord for Number
impl Ord for Number
source§impl PartialEq<Number> for Number
impl PartialEq<Number> for Number
source§impl PartialOrd<Number> for Number
impl PartialOrd<Number> for Number
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Number
impl Eq for Number
impl StructuralEq for Number
impl StructuralPartialEq for Number
Auto Trait Implementations§
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnwindSafe for Number
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