fixpoint.h

来自「图形处理算法合集3:包括图形处理、帧缓存技术、渲染、矩阵运算、建模方法」· C头文件 代码 · 共 37 行

H
37
字号
#ifndef FIXPOINT_H#define FIXPOINT_H/* Requires: LOBITS to be divisible by 2, HIBITS<=16, and LOBITS <=16. */#define HIBITS 16#define LOBITS 16#define LOMASK       (~(0xffffffff << LOBITS))#define HIMASK       ((~(0xffffffff << HIBITS)) << LOBITS)#define SIGNBIT      (1 << (HIBITS+LOBITS-1))#define OVERFLOWMASK (SIGNBIT | ~(HIMASK | LOMASK))typedef int fixpoint;typedef struct {unsigned int hi, lo, neg;} dblfixpoint;extern int fp_error;extern  fixpoint fp_max();extern  fixpoint fp_min();extern  int fp_integer();extern  int fp_fraction();extern  double fp_fraction_double();extern  fixpoint fp_multiply();extern  void fp_print();extern  fixpoint fp_fix();extern double fp_double(fixpoint x);extern int fp_dblnegative();extern dblfixpoint fp_dblnegate();extern dblfixpoint fp_dblmultiply();extern int fp_dbllessthan();extern dblfixpoint fp_dbladd();extern fixpoint fp_trunc();#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?