# JLHub documentation vs official, why are they different and which is source of truth?

**URL:** <https://discourse.julialang.org/t/jlhub-documentation-vs-official-why-are-they-different-and-which-is-source-of-truth/128606>\
**Category:** General Usage\
**Tags:** documentation\
**Created:** [May 2, 2025, 1:21am UTC](https://discourse.julialang.org/t/jlhub-documentation-vs-official-why-are-they-different-and-which-is-source-of-truth/128606 "2025-05-02T01:21:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marteaua](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marteaua/32/214927_2.png) [@marteaua](https://discourse.julialang.org/u/marteaua)\
**Post date:** [May 2, 2025, 1:21am UTC](https://discourse.julialang.org/t/jlhub-documentation-vs-official-why-are-they-different-and-which-is-source-of-truth/128606/1 "2025-05-02T01:21:51Z")

</div>

I noticed that the documentation of `inv` is richer on ~~Juliahub~~ [JLHub doc](https://www.jlhub.com/julia/manual/en/function/inv) than the [official one](https://docs.julialang.org/en/v1.11/stdlib/LinearAlgebra/#Base.inv-Tuple%7BAbstractMatrix%7D).

In particular, it specifies that matrix inversion does throw on singular matrices, while the official doesn’t. In practice:

```julia
inv( 0. ) # Inf, no exception
inv( [0;;] ) # SingularException

```

So is this throw considered part of `inv`s api or is it an undefined behavior (and an implementation dependent detail) ?

I ask because StaticArrays [doesn’t throw](https://github.com/JuliaArrays/StaticArrays.jl/issues/434), and I wonder if this is type piracy or not.

---

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [May 2, 2025, 1:47am UTC](https://discourse.julialang.org/t/jlhub-documentation-vs-official-why-are-they-different-and-which-is-source-of-truth/128606/2 "2025-05-02T01:47:43Z")

</div>

The ~~Juliahub~~ jlHub reference is for a pre-v1 version of Julia, the specific ones not immediately clear to me. For example, `broadcast` and `broadcast_function` make no mention of the loop-fusing dot syntax. In v1, `broadcast` and `Base.BroadcastFunction` exist for the same usage, but has largely been supplanted by dots.

> [@marteaua](#):
>
> the official doesn’t

It should for `Matrix` at least, I don’t know if there’s any requirement that `inv` throw `SingularException` for generic singular matrices, though `SingularException`’s docstring sure sounds that way. The jlHub reference actually has a typo in the duplicated section, `[1 2; 2 4]` is singular (`det`-erminant of zero) but `[1 2; 3 4]` is not. `inv( 0. )` is a multiplicative inverse of scalar numbers, not matrices, so `SingularException` is irrelevant.

> [@marteaua](#):
>
> I wonder if this is type piracy or not.

The `inv(::SMatrix)` method defined in `StaticArrays` dispatches on `SMatrix`, so it’s by definition not type piracy. It’s arguably violating `inv` or `SingularException`’s API.

---

<div class="post-metadata">

**Author:** ![danielwe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielwe/32/35657_2.png) [@danielwe](https://discourse.julialang.org/u/danielwe)\
**Post date:** [May 2, 2025, 3:01am UTC](https://discourse.julialang.org/t/jlhub-documentation-vs-official-why-are-they-different-and-which-is-source-of-truth/128606/3 "2025-05-02T03:01:50Z")

</div>

> [@marteaua](#):
>
> [Juliahub doc](https://www.jlhub.com/julia/manual/en/function/inv)

This is not [JuliaHub](https://juliahub.com/). I have no idea why this exists—maybe the point is to generate traffic and/or SEO for the SQL analytics platform linked on the front page, which doesn’t appear to have anything to do with Julia—but it certainly isn’t a place to look for valid, up-to-date Julia documentation. As @Benny points out, the list of functions matches pre-1.0 Julia, including names like `A_mul_B!`.

Stick to the official documentation at [https://docs.julialang.org](https://docs.julialang.org).

---

<div class="post-metadata">

**Author:** ![marteaua](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marteaua/32/214927_2.png) [@marteaua](https://discourse.julialang.org/u/marteaua)\
**Post date:** [May 2, 2025, 3:51am UTC](https://discourse.julialang.org/t/jlhub-documentation-vs-official-why-are-they-different-and-which-is-source-of-truth/128606/4 "2025-05-02T03:51:42Z")

</div>

Oh yeah this is not Juliahub sorry. I very often end up in there (when clicking first google results) because this site is very well referenced 😕.

So regarding `inv`, I’ll open an issue to understand if the throw is part of the API and deserves to be documented…
