# Bools in arithmetic operations

**URL:** <https://discourse.julialang.org/t/bools-in-arithmetic-operations/52504>\
**Category:** New to Julia\
**Tags:** boolean\
**Created:** [December 28, 2020, 12:07pm UTC](https://discourse.julialang.org/t/bools-in-arithmetic-operations/52504 "2020-12-28T12:07:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stephancb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephancb/32/14243_2.png) [@stephancb](https://discourse.julialang.org/u/stephancb)\
**Post date:** [December 28, 2020, 1:20pm UTC](https://discourse.julialang.org/t/bools-in-arithmetic-operations/52504/4 "2020-12-28T13:20:08Z")

</div>

Thanks for the link. It shows that this is a complicated issue, which I had already suspected.

In reality I have of course many candidate functions which should not work with Bool arguments. For now I restrict them like

```julia
julia> getty(m, index_offset::Int=0) = m[:, index_offset+2]
getty (generic function with 2 methods)

```

which is more restrictive than needed but easier to exclude Bool arguments.

---

_[View the full topic](https://discourse.julialang.org/t/bools-in-arithmetic-operations/52504)._
