title: Invalid Arithmetic Operator Inside Awk
body: <p>I'm trying to workaround bash's floating point arithmetic limitation via awk, but I'm encountering a syntax error which I'm having issues identifying.</p>
  
  <pre><code>declare -a mreal=()
  for s in $(seq 0 $(( ${#mint_est[@]} - 1 )))
  do
      mreal=( "${mreal[@]}" "$(echo ${mreal_est[$s]} | \
          awk -v int="${mint_est[$s]}" -v tot="$mtotal" \
          '{printf("%s", $1 + (1.0 - int/$1)*tot)}')" )
  done
  </code></pre>
  
  <p>Here <code>mreal_est</code> and <code>mint_est</code>are arrays consisting of 4 floating point values each and <code>mtotal</code> is a variable set to a floating point value.  The syntax errors from awk are:</p>
  
  <pre><code>awk: {printf("%s", $1 + (1.0 - int/$1)*tot)}
  awk:                              ^ syntax error
  awk: {printf("%s", $1 + (1.0 - int/$1)*tot)}
  awk:                                  ^ syntax error
  awk: {printf("%s", $1 + (1.0 - int/$1)*tot)}
  awk:                                       ^ syntax error
  </code></pre>
  
  <p>for each iteration through the loop.  I am trying to get the array <code>mreal</code> populated with floating point values based upon the arithmetic defined in awk's <code>printf</code> statement.  Any ideas how this might be corrected?</p>