# Strange array calculation behaviour

**URL:** <https://discourse.julialang.org/t/strange-array-calculation-behaviour/35476>\
**Category:** New to Julia\
**Created:** [March 3, 2020, 5:33pm UTC](https://discourse.julialang.org/t/strange-array-calculation-behaviour/35476 "2020-03-03T17:33:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bjorn\_De](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bjorn_de/32/13174_2.png) [@Bjorn\_De](https://discourse.julialang.org/u/Bjorn_De)\
**Post date:** [March 3, 2020, 5:33pm UTC](https://discourse.julialang.org/t/strange-array-calculation-behaviour/35476/1 "2020-03-03T17:33:04Z")

</div>

Hi! I have two arrays, with both the same size. I want to do some simple calculations such as:

```julia
arr = (arr1 ./ arr2) .* 100 

```

`maximum(arr1)` is 31.0 and `maximum(arr2)` is 48.  
So I assume that the highest value or arr should be `(31/48) * 100 = 64.583`  
But if I do `maximum(arr)` I get 180.0

I have no idea where this value comes from.  
I use Julia 1.1.0 on Linux  
Thanks for you help!

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [March 3, 2020, 5:35pm UTC](https://discourse.julialang.org/t/strange-array-calculation-behaviour/35476/2 "2020-03-03T17:35:35Z")

</div>

To get maximum possible value of `arr` you should divide maximum of `arr1` by the minimum of `arr2`.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [March 3, 2020, 5:48pm UTC](https://discourse.julialang.org/t/strange-array-calculation-behaviour/35476/3 "2020-03-03T17:48:41Z")

</div>

`[3, 2] ./ [6, 8]` is `[0.2, 0.25]`, maximum is `0.25`, which is not `3/8`

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [March 3, 2020, 5:56pm UTC](https://discourse.julialang.org/t/strange-array-calculation-behaviour/35476/4 "2020-03-03T17:56:37Z")

</div>

Assuming all positive.
