Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 28th, 2010  |  syntax: C  |  size: 0.62 KB  |  views: 135  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     int32_t tmp;
  2.     for (i = 0; i < ARRAYSIZE_PLOT; ++i)
  3.     {
  4.         tmp = output[i].r * output[i].r + output[i].i * output[i].i;
  5.  
  6.         while (tmp > 0x7FFFFFFF) tmp >>= 1; /* we can only work on positive values */
  7.         if (tmp > 0)
  8.         {
  9.             tmp = fp_sqrt(tmp, 8); /* linear scaling, nothing
  10.                                       bad should happen */
  11.      
  12.             if (logarithmic)
  13.             {
  14.                 tmp = get_log_value(tmp << 8); /* the log function
  15.                                                   expects s15.16 values */
  16.             }
  17.         }
  18.         plot[i] = tmp;
  19.     }
clone this paste RAW Paste Data