pub trait NumericOps {
Show 22 methods
// Required methods
fn new(num: i64) -> Self
where Self: Sized;
fn new_f64(num: f64) -> Self
where Self: Sized;
fn value_of(self) -> i64;
fn register_type(&self) -> RegisterType;
// Provided methods
fn unit(&self) -> Option<&'static str> { ... }
fn value_f64(self) -> f64
where Self: Sized { ... }
fn pt_value(self, prec: Option<u8>) -> f64
where Self: Sized { ... }
fn px_value(self, prec: Option<u8>) -> f64
where Self: Sized { ... }
fn absolute(self) -> Self
where Self: Sized { ... }
fn sign(self) -> i8
where Self: Sized { ... }
fn negate(self) -> Self
where Self: Sized { ... }
fn add<T: NumericOps>(self, other: T) -> Self
where Self: Sized { ... }
fn subtract<T: NumericOps>(self, other: T) -> Self
where Self: Sized { ... }
fn multiply<T: NumericOps>(self, other: T) -> Self
where Self: Sized { ... }
fn arith_ceiling() -> i64 { ... }
fn divide<T: NumericOps>(self, other: T) -> Self
where Self: Sized { ... }
fn divideround<T: NumericOps>(self, other: T) -> Self
where Self: Sized { ... }
fn smaller<T: NumericOps>(self, other: T) -> Self
where Self: Sized { ... }
fn larger<T: NumericOps>(self, other: T) -> Self
where Self: Sized { ... }
fn to_token(self) -> Token
where Self: Sized { ... }
fn into_glue_type(self) -> Glue
where Self: Sized { ... }
fn to_attribute(&self) -> String
where Self: Display { ... }
}Required Methods§
fn new(num: i64) -> Selfwhere
Self: Sized,
fn new_f64(num: f64) -> Selfwhere
Self: Sized,
fn value_of(self) -> i64
fn register_type(&self) -> RegisterType
Provided Methods§
fn unit(&self) -> Option<&'static str>
fn value_f64(self) -> f64where
Self: Sized,
fn pt_value(self, prec: Option<u8>) -> f64where
Self: Sized,
fn px_value(self, prec: Option<u8>) -> f64where
Self: Sized,
fn absolute(self) -> Selfwhere
Self: Sized,
fn sign(self) -> i8where
Self: Sized,
fn negate(self) -> Selfwhere
Self: Sized,
fn add<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn subtract<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn multiply<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
Sourcefn arith_ceiling() -> i64
fn arith_ceiling() -> i64
The arith_error clamp bound: max_dimen for dimensions and glue,
TeX’s integer infinity for counts (overridden by Number).
Sourcefn divide<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn divide<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
Truncating division
Sourcefn divideround<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn divideround<T: NumericOps>(self, other: T) -> Selfwhere
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.
fn smaller<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn larger<T: NumericOps>(self, other: T) -> Selfwhere
Self: Sized,
fn to_token(self) -> Tokenwhere
Self: Sized,
fn into_glue_type(self) -> Gluewhere
Self: Sized,
fn to_attribute(&self) -> Stringwhere
Self: Display,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".