# Inconsistant precision?

**URL:** https://discourse.julialang.org/t/inconsistant-precision/92674
**Category:** General Usage
**Tags:** precision
**Created:** [January 8, 2023, 3:06pm UTC](https://discourse.julialang.org/t/inconsistant-precision/92674 "2023-01-08T15:06:25Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![sgaure](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sgaure/32/14779_2.png) [@sgaure](https://discourse.julialang.org/u/sgaure)
#### Post date: [January 8, 2023, 5:34pm UTC](https://discourse.julialang.org/t/inconsistant-precision/92674/10 "2023-01-08T17:34:12Z")

</div>

And if you think the function might be used in many different contexts, like somebody calls it with `fun(mat')`, the adjoint of `mat`, which is of type `Adjoint`, you should consider using the signature `fun(m::AbstractMatrix{<:Complex})`. This will allow various subtypes of matrices as well, like `Hermitian`, `Diagonal`, `Adjoint`, `Bidiagonal` etc. Then it will work as now, and you can later add specializations for these with e.g. `function fun(m::Diagonal{<:Complex}) ...`, if needed.

Though with `AbstractMatrix` comes a Pandora’s box of indexing. Somebody might have a matrix with indices starting at -23 or some such stuff. There exists stuff for handling such things, it’s described in the manual.

---

_[View the full topic](https://discourse.julialang.org/t/inconsistant-precision/92674)._
