calc median g_
This commit is contained in:
parent
be7e5da172
commit
4342f0a5f8
@ -18,7 +18,8 @@ function g_median {
|
|||||||
if (($g_num_elements % 2 == 1))
|
if (($g_num_elements % 2 == 1))
|
||||||
then
|
then
|
||||||
# odd number
|
# odd number
|
||||||
g_median=${g_sorted_numbers[$g_middle]}
|
g_median="${g_sorted_numbers[$g_middle]}"
|
||||||
|
echo "$g_median - ${g_sorted_numbers[$g_middle]} - $g_middle"
|
||||||
else
|
else
|
||||||
# even number
|
# even number
|
||||||
g_calc "(${g_sorted_numbers[$g_middle - 1]} + ${g_sorted_numbers[$g_middle]}) / 2"
|
g_calc "(${g_sorted_numbers[$g_middle - 1]} + ${g_sorted_numbers[$g_middle]}) / 2"
|
||||||
|
Loading…
Reference in New Issue
Block a user