Skip to main content

Number

Struct Number 

Source
pub struct Number(pub i64);

Tuple Fields§

§0: i64

Implementations§

Source§

impl Number

Source

pub fn to_attribute(&self) -> String

Source§

impl Number

Source

pub fn from_str_value(spec: &str) -> Number

Perl Number.pm:31-34 int($number): Perl’s numeric coercion, truncated toward zero ("1e3" is 1000, "1.5" 1); a string that is not wholly a number Warns as Perl’s isn't numeric and reads its numeric prefix ("12abc" 12).

Trait Implementations§

Source§

impl Clone for Number

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Number

Source§

impl Debug for Number

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Number

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for Number

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Number

Source§

impl From<&RegisterValue> for Number

Source§

fn from(v: &RegisterValue) -> Number

Converts to this type from the input type.
Source§

impl From<Catcode> for Number

Source§

fn from(c: Catcode) -> Number

Converts to this type from the input type.
Source§

impl From<Number> for Tokens

Source§

fn from(v: Number) -> Tokens

Converts to this type from the input type.
Source§

impl From<Number> for Option<Tokens>

Source§

fn from(v: Number) -> Option<Tokens>

Converts to this type from the input type.
Source§

impl From<Number> for Stored

Source§

fn from(value: Number) -> Self

Converts to this type from the input type.
Source§

impl From<Number> for ArgWrap

Source§

fn from(t: Number) -> Self

Converts to this type from the input type.
Source§

impl From<Number> for RegisterValue

Source§

fn from(n: Number) -> RegisterValue

Converts to this type from the input type.
Source§

impl From<Number> for Option<RegisterValue>

Source§

fn from(n: Number) -> Option<RegisterValue>

Converts to this type from the input type.
Source§

impl From<Number> for Dimension

Source§

fn from(n: Number) -> Dimension

Converts to this type from the input type.
Source§

impl From<Number> for Glue

Source§

fn from(n: Number) -> Glue

Converts to this type from the input type.
Source§

impl From<Number> for MuGlue

Source§

fn from(n: Number) -> MuGlue

Converts to this type from the input type.
Source§

impl From<RegisterValue> for Number

Source§

fn from(v: RegisterValue) -> Number

Converts to this type from the input type.
Source§

impl From<String> for Number

Source§

fn from(s: String) -> Number

Converts to this type from the input type.
Source§

impl IntoDigestedOptionResult<Result<Option<Digested>, Error>> for Number

Source§

impl IntoRegisterValueOption<Option<RegisterValue>> for Number

Source§

impl NumericOps for Number

Source§

fn arith_ceiling() -> i64

The arith_error clamp bound: max_dimen for dimensions and glue, TeX’s integer infinity for counts (overridden by Number).
Source§

fn new(number: i64) -> Self

Source§

fn new_f64(number: f64) -> Self

Source§

fn value_of(self) -> i64

Source§

fn register_type(&self) -> RegisterType

Source§

fn unit(&self) -> Option<&'static str>

Source§

fn value_f64(self) -> f64
where Self: Sized,

Source§

fn pt_value(self, prec: Option<u8>) -> f64
where Self: Sized,

Source§

fn px_value(self, prec: Option<u8>) -> f64
where Self: Sized,

Source§

fn absolute(self) -> Self
where Self: Sized,

Source§

fn sign(self) -> i8
where Self: Sized,

Source§

fn negate(self) -> Self
where Self: Sized,

Source§

fn add<T: NumericOps>(self, other: T) -> Self
where Self: Sized,

Source§

fn subtract<T: NumericOps>(self, other: T) -> Self
where Self: Sized,

Source§

fn multiply<T: NumericOps>(self, other: T) -> Self
where Self: Sized,

Source§

fn divide<T: NumericOps>(self, other: T) -> Self
where Self: Sized,

Truncating division
Source§

fn divideround<T: NumericOps>(self, other: T) -> Self
where Self: Sized,

Rounding division — eTeX’s quotient(n,d) (etex.ch “Declare subprocedures for scan_expr”): work on magnitudes and round half AWAY from zero, so \numexpr -1/2 = -1 and -7/2 = -4 (pdflatex-probed). Perl Number.pm int(0.5 + n/d) truncates toward zero and yields 0 / -3 (KNOWN_PERL_ERRORS #124); l3fp’s \__fp_mul_cases_o:NnNnww case index (#5 #2 #8) / 2 * 2 + 7 (expl3-code.tex:18724-18760) relies on the TeX rounding, so 0 * x inside a +/- expression collapsed the whole \fp_eval:n to 0 (wheelchart’s tikz transform determinant, wheelchart.sty:2423). A zero divisor is TeX’s arith_error → 0.
Source§

fn smaller<T: NumericOps>(self, other: T) -> Self
where Self: Sized,

Source§

fn larger<T: NumericOps>(self, other: T) -> Self
where Self: Sized,

Source§

fn to_token(self) -> Token
where Self: Sized,

Source§

fn into_glue_type(self) -> Glue
where Self: Sized,

Source§

fn to_attribute(&self) -> String
where Self: Display,

Source§

impl Object for Number

Source§

fn revert(&self) -> Result<Tokens>

each concrete object needs to provide its own path back to tokens
Source§

fn be_digested(self) -> Result<Digested>

Source§

fn stringify(&self) -> String

Source§

fn isa_box(&self) -> bool

Source§

fn is_expandable(&self) -> bool

Source§

fn is_definition(&self) -> bool

Source§

fn is_comment(&self) -> bool

Source§

fn get_locator(&self) -> Option<Locator>

The object’s stored source locator, if it has one. None is the honest “no recorded source position” (replacing the old Locator::default() file!()/line!() sentinel). For “where the parser is now” (error reporting, box creation), use the free fn gullet::get_locator().
Source§

fn get_origin(&self) -> DefinitionOrigin

Who made this definition (K1 provenance, definition::origin). The default is Unknown, which counts as LaTeXML’s own.
Source§

impl PartialEq for Number

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Number

Source§

impl TryFrom<ArgWrap> for Number

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(aw: ArgWrap) -> Result<Number>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoResultArgWrap<Result<ArgWrap, Error>> for T
where T: Into<ArgWrap>,

Source§

fn into_result_argwrap(self) -> Result<ArgWrap, Error>

performs the conversion
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.