title: Multiply every element of an array by the same scalar in zsh
body: <p>I would like to multiply every element in an array in zsh by the same scalar. I would be able to do this very easily in Python, but have looked in many places and cannot figure out how to do it in a zsh script.</p>
  <p>I would like to write code like</p>
  <pre><code>#!/bin/zsh
  mean=(1 2 2 1 -1 -2 -2 -1)
  echo $((2 * $mean))
  </code></pre>
  <p>But when I try to do this I get the error message</p>
  <pre><code>bad math expression: operator expected at `2 2 1 -1 -...'
  </code></pre>
  <p>Any and all help would be appreciated. I can't seem to find anything online that is even remotely close to what I'm trying to figure out how to do.</p>