Strange array calculation behaviour

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

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!

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

4 Likes

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

Assuming all positive.

1 Like