⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zc030x_fp.h

📁 中星微301摄想头最新驱动
💻 H
字号:
#ifndef h_Zc030x_FPU_h#define h_Zc030x_FPU_h/* Include kernel types */#include <linux/types.h>/* This code is greatly inspired from   Author:  William A. Rossi           175 Burnt Hill Rd           Hope, RI 02831    http://www.rossi.com/sqr2.htm           bill@rossi.com             It was in public domain, in C++ and using BIGINT libraryI removed BIGINT library, make it C based, and used 64 bits integers to emulate floats (with 2^-18 precision, not so bad) *//* The maximum number of valid digit is 19 */#define MaxDigits   19/* The half number of valid digits is 9 */#define HalfDigits  9/* Define the FPNum structure */typedef struct {    uint64_t    Mant;       /* Easy to guess, this is the mantissa */    int16_t     Exp;        /* This is the exponent */    int8_t      Sign;       /* Sign 1 or -1 (0 make this number invalid) */} FPNum;/* Initialize a FPNum from a char (very easy) */void InitFPNum(FPNum * this, const char * Number);/* Get a FPNum output as string */void GetFPNumAsString(FPNum * this, char * output);/* Get a number as an Int64 */int64_t GetFPNumAsInt(FPNum * this);/* Add 2 FPNum numbers */FPNum Add(const FPNum a, const FPNum b);/* Multiply 2 FPNum numbers */FPNum Mul(const FPNum a, const FPNum b);/* Create a FPNum from an int */const FPNum CreateFPNumFromInt(int32_t Number);#endif

⌨️ 快捷键说明

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