zc030x_fp.h
来自「Linux下USB接口的摄像头源码,很详细!对写USB接口驱动有很大帮助的」· C头文件 代码 · 共 51 行
H
51 行
#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 + =
减小字号Ctrl + -
显示快捷键?