Enum boa::syntax::ast::op::NumOp[][src]

pub enum NumOp {
    Add,
    Sub,
    Div,
    Mul,
    Exp,
    Mod,
}
Expand description

Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value.

More information:

Variants

Add

The addition operator produces the sum of numeric operands or string concatenation.

Syntax: x + y

More information:

Sub

The subtraction operator subtracts the two operands, producing their difference.

Syntax: x - y

More information:

Div

The division operator produces the quotient of its operands where the left operand is the dividend and the right operand is the divisor.

Syntax: x / y

More information:

Mul

The multiplication operator produces the product of the operands.

Syntax: x * y

More information:

Exp

The exponentiation operator returns the result of raising the first operand to the power of the second operand.

Syntax: x ** y

The exponentiation operator is right-associative. a ** b ** c is equal to a ** (b ** c).

More information:

Mod

The remainder operator returns the remainder left over when one operand is divided by a second operand.

Syntax: x % y

The remainder operator always takes the sign of the dividend.

More information:

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Marks all contained Gcs.

Increments the root-count of all contained Gcs.

Decrements the root-count of all contained Gcs.

Runs Finalize::finalize() on this object and all contained subobjects Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Convert the Rust type which implements NativeObject to a &dyn Any.

Convert the Rust type which implements NativeObject to a &mut dyn Any.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.