pub enum ArithmeticOperator {
Add,
Subtract,
Multiply,
Divide,
Remainder,
Power,
FloorDiv,
}Expand description
Arithmetic operators for numeric computations.
Variants§
Add
Addition (lhs + rhs)
Subtract
Subtraction (lhs - rhs)
Multiply
Multiplication (lhs * rhs)
Divide
Division (lhs / rhs)
For integers, division by zero panics in dense arrays and nullifies in masked arrays. For floating-point, follows IEEE 754 (yields ±Inf or NaN).
Remainder
Modulus/remainder operation (lhs % rhs)
Behaviour matches Rust’s % operator. Division by zero handling follows same
rules as Divide operation.
Power
Exponentiation (lhs ^ rhs)
For integers, uses repeated multiplication. For floating-point, uses pow() function.
Negative exponents on integers may yield zero due to truncation.
FloorDiv
Floor division (lhs // rhs)
Rounds the quotient towards negative infinity. For unsigned integers this is
identical to truncation division. For signed integers, when the remainder is
non-zero and the operands have different signs, the result is one less than
truncation division. For floating-point, equivalent to (lhs / rhs).floor().
Trait Implementations§
Source§impl Clone for ArithmeticOperator
impl Clone for ArithmeticOperator
Source§fn clone(&self) -> ArithmeticOperator
fn clone(&self) -> ArithmeticOperator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more