# Logical aggregation functions

**URL:** https://discourse.julialang.org/t/logical-aggregation-functions/84250
**Category:** General Usage
**Tags:** functions, boolean
**Created:** [July 15, 2022, 3:38am UTC](https://discourse.julialang.org/t/logical-aggregation-functions/84250 "2022-07-15T03:38:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Lincoln\_Hannah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lincoln_hannah/32/19198_2.png) [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)
#### Post date: [July 15, 2022, 3:38am UTC](https://discourse.julialang.org/t/logical-aggregation-functions/84250/1 "2022-07-15T03:38:42Z")

</div>

Does Julia have logical aggregation functions ?  
Something like

`AND( [true, true, false] )` = false  
`OR( [true, true, false] )` = true

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [July 15, 2022, 3:54am UTC](https://discourse.julialang.org/t/logical-aggregation-functions/84250/2 "2022-07-15T03:54:25Z")

</div>

`all` and `any`

---

<div class="post-metadata">

### Author: ![jmair](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmair/32/35117_2.png) [@jmair](https://discourse.julialang.org/u/jmair)
#### Post date: [July 15, 2022, 7:36am UTC](https://discourse.julialang.org/t/logical-aggregation-functions/84250/3 "2022-07-15T07:36:10Z")

</div>

For general aggregates, you can use the `reduce` function, which can work with any arbitrary two-argument functions. In this case, `all` and `any` implementations are likely faster due to the ability to short circuit the evaluation.
