# Max function for two array arguments

**URL:** <https://discourse.julialang.org/t/max-function-for-two-array-arguments/61181>\
**Category:** New to Julia\
**Created:** [May 15, 2021, 2:20am UTC](https://discourse.julialang.org/t/max-function-for-two-array-arguments/61181 "2021-05-15T02:20:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://discourse.julialang.org/u/Beliavsky)\
**Post date:** [May 15, 2021, 2:20am UTC](https://discourse.julialang.org/t/max-function-for-two-array-arguments/61181/1 "2021-05-15T02:20:54Z")

</div>

The `max` function does what I expect for two scalar arguments, but why is `max([3,5],[1,6])` equal to `[3,5]` and `max([2,5],[3,3])` equal to `[3,3]`?

I can get Fortran-like behavior with `max.([3,5],[1,6])` which gives `[3,6]`.

---

<div class="post-metadata">

**Author:** ![PabloZubieta](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@PabloZubieta](https://discourse.julialang.org/u/PabloZubieta)\
**Post date:** [May 15, 2021, 2:36am UTC](https://discourse.julialang.org/t/max-function-for-two-array-arguments/61181/2 "2021-05-15T02:36:00Z")

</div>

Here `max` is comparing `[3,5]` and `[1,6]` or `[2,5]` and `[3,3]`, but comparison for vectors is lexicographic (that is, it compares the first element and each time it needs to break ties, it compares the next one, and so on)
