定点.浮点运算程序.docVIP

  • 9
  • 0
  • 约2.81千字
  • 约 4页
  • 2018-02-04 发布于河南
  • 举报
定点.浮点运算程序

#include csl.h #include stdio.h #define Qx 4 #define Qy 4 #define Qz 4 /*in the fixed example,the default value of Q is 4.*/ /*The range of date is [-2048,2047.9375]*/ void fixed_add(int x,int y) { long temp; int z; temp=y(Qx-Qy); temp+=x; if (Qx=Qz) { z=temp(Qx-Qz); } else { z=temp(Qz-Qx); } fprintf(stdout,the result of fixed_add was %i !\n,z); } void fixed_diejia() { int z=0,i; for(i=1;i=20;i++) z=z+i; fprintf(stdout,the result of fixed_diejia was %i !\n,z); } void fixed_sub(int x,int y

文档评论(0)

1亿VIP精品文档

相关文档