# values_dot proc

Source: https://ref.dm-lang.org/proc/values_dot
Added in BYOND 516.

### Format
> `values_dot(A, B)`

### Returns
> The dot product of all associated numbers in A and B

### Args
> A, B: An [associative list](https://ref.dm-lang.org/list/associations.md) or [alist](https://ref.dm-lang.org/proc/alist.md)

Returns the dot product of two associative lists. If the same item exists in both lists, the associated values are multiplied together as numbers. All of those multiplications are added together to form the dot product. This is similar to [vector dot products](https://ref.dm-lang.org/vector/proc/Dot.md).

```dm /values_dot/
var/list/first = list("a"=1, "b"=2, "c"=3)
var/list/second = list("b"=4, "c"=5, "d"=6)
// first["a"] * second["a"] = 1 * 0 = 0
// first["b"] * second["b"] = 2 * 4 = 8
// first["c"] * second["c"] = 3 * 5 = 15
// first["d"] * second["d"] = 0 * 6 = 0
// total is 23
usr << values_dot(first, second)  // outputs 23
```

This is a convenience proc for games trying to eke out high performance.

### See also
- [list associations](https://ref.dm-lang.org/list/associations.md)
- [values_sum proc](https://ref.dm-lang.org/proc/values_sum.md)
- [values_product proc](https://ref.dm-lang.org/proc/values_product.md)
- [values_cut_over proc](https://ref.dm-lang.org/proc/values_cut_over.md)
- [values_cut_under proc](https://ref.dm-lang.org/proc/values_cut_under.md)
- [alist proc](https://ref.dm-lang.org/proc/alist.md)
