# ExpressionNumber

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/utils/number_expression/trait-expressionnumber/

**trait** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
trait ExpressionNumber: Copy
```

A number type the expressions are evaluated with: its arithmetic, `None` where a result is not
a value of the type.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/number_expression.rs#L31)

## Members

- [`is_zero`](#function-is_zero)
- [`add`](#function-add)
- [`sub`](#function-sub)
- [`mul`](#function-mul)
- [`div`](#function-div)
- [`pow`](#function-pow)

<a id="function-is_zero"></a>

### is_zero

```rust
fn is_zero(self: &Self) -> bool
```

Whether the number is zero (a divisor that is zero is a division by zero).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/number_expression.rs#L33)

<a id="function-add"></a>

### add

```rust
fn add(self: Self, other: Self) -> Option<Self>
```

The sum.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/number_expression.rs#L35)

<a id="function-sub"></a>

### sub

```rust
fn sub(self: Self, other: Self) -> Option<Self>
```

The difference.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/number_expression.rs#L37)

<a id="function-mul"></a>

### mul

```rust
fn mul(self: Self, other: Self) -> Option<Self>
```

The product.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/number_expression.rs#L39)

<a id="function-div"></a>

### div

```rust
fn div(self: Self, other: Self) -> Option<Self>
```

The quotient; `other` is not zero.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/number_expression.rs#L41)

<a id="function-pow"></a>

### pow

```rust
fn pow(self: Self, exponent: Self) -> Option<Self>
```

`self` raised to the power `exponent`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/number_expression.rs#L43)

## Trait implementations

- [`ExpressionNumber`](/docs/0.5.0/api/ferroui-controls/utils/number_expression/trait-expressionnumber/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
