I am assuming you are using bash or perhaps a POSIX shell like dash.
Your error is telling you that it is not possible to do such a task as these shells have INTEGER arithmetic only.
If you need floating/fixed point arithmetic then you will have to do workarounds using, bc, dc, python, perl, awk or any other methods that are capable of such mechanisms.
(Just an observation, you have both, ${barr1[$i]} and also ${harr1[j]} are these correct?)
EDIT:
Note the second one should have ${harr1[$j]}
An example longhand using INTEGER arithmetic and FIXED point, OSX 10.14.6, default bash terminal:
Last login: Mon Oct 21 18:25:40 on ttys000
AMIGA:amiga~> x=.098765
AMIGA:amiga~> y=10.3
AMIGA:amiga~> x=$( printf "%.f" ${x}e+12 )
AMIGA:amiga~> y=$( printf "%.f" ${y}e+12 )
AMIGA:amiga~> printf "%.12f\n" $(( y - x ))e-12
10.201235000000
AMIGA:amiga~> _
Nice wisecracker. This method would rap up into a fun little bash sum function:
function sum
{
local word exp var
[[ "$1" = *= ]] && var="-v ${1%=}" && shift
for word in "$@"
do
case "$word" in
[0-9.]*|-[0-9.]*|+|-)
printf -v ans "%.f" "${word}e+12" 2>/dev/null || ans=$word
exp="$exp $ans" ;;
*) echo "sum: $word operator not supported" >&2 ; exit 1 ;;
esac
done
printf $var "%.8f\n" $(( $exp ))e-12
}
sum val= 3.58047 - .68 + .858 + -1.2
echo $val