# `Numbers.Protocols.Addition`

For supporting `Numbers.add/2`.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `add`

```elixir
@spec add(t(), t()) :: t()
```

Adds two numbers together.

# `add_id`

```elixir
@spec add_id(t()) :: t()
```

Should return the 'additive identity' of the same type as the argument.
This is the value that can be added to another number,
to let the result remain equal to that number.

(For integers, this is `0`, for floats, `0.0`. Most other numeric types have their own 'zero' variant as well.)

This should be defined so that:

    a = some_num
    add(a, add_id()) == a
    add(add_id(), a) == a

If the numeric structure also implements `Numbers.Protocols.Subtraction`, the following should also be true:

    a = some_num
    sub(a, add_id()) == a
    sub(add_id(), a) == a

(Note that it is fine if the result is not structurally identical, as long as it is logically equal.)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
