编辑代码

#include <stdio.h>
#define int32_t int
#define uint16_t unsigned short
#define int64_t long
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
void filtLowPass32(int32_t u, uint16_t coef, int32_t *y) {
  int64_t tmp;  
  tmp = ((int64_t)((u << 4) - (*y >> 12)) * coef) >> 4;
  tmp = CLAMP(tmp, -2147483648LL, 2147483647LL);  // Overflow protection: 2147483647LL = 2^31 - 1
  *y = (int32_t)tmp + (*y);
}
int x=0;
uint16_t c=4096;
int y=230;
short test=-78;
int main () {
    //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
    //printf("Hello world!     - c.jsrun.net.");
/*for(int i=0;i<50;i++){
  filtLowPass32(x,c,&y);
  printf("%d\r\n",y>>16);
}*/
printf("%d",test<<1);
    return 0;
}