繁体   English   中英

stdfloat.h版本的stdint.h

[英]stdfloat.h version of stdint.h

您使用什么标准的命名约定和/或数学库? 我目前使用

#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库吗? 我现在正在使用的是:

 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; 

你用什么??

好吧,由于您的问题也被标记为C ++,所以我建议使用Boost.Integer 如果您对C ++解决方案不感兴趣,请从您的问题中删除该标签。

图书馆应涵盖哪些方面? 仅对数据类型进行“直接”命名? 然后,使用您自己的定义。 如果不限于数据类型,则几乎可以使用任何数学库,因为typedef只是众所周知的数据类型的“个性化”名称;)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM