| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- /*******************************************************
- * 版本号: 1.00 版本号
- * 文件名: floatspc.c
- * 生成日期:2005.11.11
- * 作者: 钟振新
- ******************************************************/
- #ifndef FLOAT_SPECIAL
- #define FLOAT_SPECIAL
- #ifdef MODE_LITTLE_ENDIAN
- #define CPU_ENDIAN_BIG 0
- #else
- #define CPU_ENDIAN_BIG 1 // 1-大尾格式,用于motorola等cpu
- #endif
- #define _FPCLASS_SNAN 1
- #define _FPCLASS_QNAN 2
- #define _FPCLASS_OVER 3
- #ifndef FAST
- #define FAST
- #endif
- #ifndef NULL
- #define NULL 0
- #endif
- #ifdef __cplusplus
- extern "C"{
- #endif
- typedef union _u08
- {
- unsigned char value;
- } _08;
- typedef union _u16
- {
- struct
- {
- #if CPU_ENDIAN_BIG
- _08 high08, low08;
- #else
- _08 low08, high08;
- #endif
- } s;
- unsigned short value;
- } _16;
- typedef union _u32
- {
- struct
- {
- #if CPU_ENDIAN_BIG
- _16 high16, low16;
- #else
- _16 low16, high16;
- #endif
- } s;
- uint32_t value;
- } _32;
- typedef struct
- {
- _32 i32;
- } _rtl_float_t;
- int isnan_f (void *_f);
- /*长整数快速开根号*/
- unsigned short sqrt_16(uint32_t x);
-
- float sqrt_32f(uint32_t x);
- /*浮点数快速开根号*/
- float sqrt_f(float x);
- DWORD sqrt_32fix(DWORD x);
- #ifdef __cplusplus
- }
- #endif
- #endif
|