average (float array[], int array_length)
{
  float total = 0;

  for (i = 0; i < array_length; i ++)
  {
    total += array[i];
  }

  return (i != 0) ? (total / i) : 0;                                           /* !!! */
}
