# How to tell if a thing is invertible?

**URL:** <https://discourse.julialang.org/t/how-to-tell-if-a-thing-is-invertible/16584>\
**Category:** General Usage\
**Created:** [October 20, 2018, 11:36pm UTC](https://discourse.julialang.org/t/how-to-tell-if-a-thing-is-invertible/16584 "2018-10-20T23:36:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Post date:** [October 21, 2018, 1:17am UTC](https://discourse.julialang.org/t/how-to-tell-if-a-thing-is-invertible/16584/4 "2018-10-21T01:17:56Z")

</div>

@bobcassels has another question outstanding: [How to test whether comparison is defined for a type?](https://discourse.julialang.org/t/how-to-test-whether-comparison-is-defined-for-a-type/16583)  
I thought that the `applicable function might help there too, but it doesn’t.

```julia
julia> applicable(<, Mod29(1) , Mod29(3))
true

```

but this fails

```julia
julia> Mod29(1) < Mod29(3)
ERROR: < not defined for Mod29

```

Because

```julia
(< )(x::T, y::T) where {T<:Real} = no_op_err("<" , T) 
# see base/promotion.jl line 426

```

That is, the `<` method applies to the arguments, but unfortunately that method forces an error.

So my suggestion to use the `applicable` function is not foolproof 🙁

---

_[View the full topic](https://discourse.julialang.org/t/how-to-tell-if-a-thing-is-invertible/16584)._
