首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >stdfloat.h版本的stdint.h

stdfloat.h版本的stdint.h
EN

Stack Overflow用户
提问于 2010-11-06 17:40:46
回答 2查看 27.5K关注 0票数 8

您使用什么标准命名约定和或数学库?我现在用

代码语言:javascript
复制
#include <stdint.h>
typedef float  float32_t;
typedef double float64_t;
/*! ISO C99: 7.18 Integer types 8, 16, 32, or 64 bits
intN_t = two’s complement signed integer type with width N, no padding bits.
uintN_t = an unsigned integer type with width N.
floatN_t = N bit IEE 754 float.

        uintN_t             intN_t              floatN_t
bits    unsigned-integer    signed-integer      IEE754 float
8       
16      unsigned short      short               ??"half"
32      unsigned            int                 float
64      unsigned long       long                double
128                                             ?? "Long double" "quad" ??*/

但正如你所看到的,我还没有决定建一个数学图书馆。

原始问题:推荐的带有直进命名约定的小型数学库.

有谁知道任何具有简单命名约定的小型C库吗?这就是我现在使用的:

代码语言:javascript
复制
typedef unsigned short UInt16; typedef short    Int16;
typedef unsigned       UInt32; typedef int      Int32; typedef float  Float32;
typedef unsigned long  UInt64; typedef long int Int64; typedef double Float64;

你用什么??

EN

回答 2

Stack Overflow用户

发布于 2010-11-06 18:20:30

好吧,既然你的问题也被标记为C++,我建议Boost.Integer。如果您对C++解决方案不感兴趣,请从您的问题中删除该标记。

票数 1
EN

Stack Overflow用户

发布于 2010-11-06 18:45:18

图书馆应该涵盖哪些方面?数据类型的“直截了当”命名?那就用你自己的定义吧。如果不限于数据类型,您几乎可以使用任何数学库,因为类型设置只是众所周知的数据类型的“个性化”名称;)

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4114284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档