# Matrix multiplication with custom types

**URL:** <https://discourse.julialang.org/t/matrix-multiplication-with-custom-types/25280>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [June 13, 2019, 10:26pm UTC](https://discourse.julialang.org/t/matrix-multiplication-with-custom-types/25280 "2019-06-13T22:26:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [June 13, 2019, 10:39pm UTC](https://discourse.julialang.org/t/matrix-multiplication-with-custom-types/25280/2 "2019-06-13T22:39:22Z")

</div>

Welcome to Julia!

So the error you’re running into is that it wants a `zero` function defined, which it uses at some point during the matrix multiplication algorithm. So it wants you to define a function `zero(::Point) = ...` that returns a zero object for the `Point` type, i.e. something so that that `x + zero(Point) == x` whenever `x` is a `Point` (in other words, `zero(T)` should return the additive identity for things of type `T`, but it doesn’t know what this is for `Point`s, so it wants you to define the method).

Formatting tips: [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

General posting tips: [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757)

---

_[View the full topic](https://discourse.julialang.org/t/matrix-multiplication-with-custom-types/25280)._
