C++标准模板(STL)- 类型支持 (定宽整数类型)(INT8_MIN,INT_FAST8_MIN,INT_LEAST8_MIN,INTPTR_MIN,INTMAX_MIN )

定宽整数类型

宏常量

定义于头文件 <cstdint>
有符号整数:最小值

INT8_MININT16_MININT32_MININT64_MIN

int8_t、int16_t、int32_t、int64_t 类型对象的最小值
(宏常量)

INT_FAST8_MININT_FAST16_MININT_FAST32_MININT_FAST64_MIN

int_fast8_t、int_fast16_t、int_fast32_t、int_fast64_t 类型对象的最小值
(宏常量)

INT_LEAST8_MININT_LEAST16_MININT_LEAST32_MININT_LEAST64_MIN

int_least8_t、int_least16_t、int_least32_t、int_least64_t 类型对象的最小值
(宏常量)

INTPTR_MIN

intptr_t 类型对象的最小值
(宏常量)

INTMAX_MIN

intmax_t 类型对象的最小值
(宏常量)
有符号整数:最大值

INT8_MAXINT16_MAXINT32_MAXINT64_MAX

int8_t、int16_t、int32_t、int64_t 类型对象的最大值
(宏常量)

INT_FAST8_MAXINT_FAST16_MAXINT_FAST32_MAXINT_FAST64_MAX

int_fast8_t、int_fast16_t、int_fast32_t、int_fast64_t 类型对象的最大值
(宏常量)

INT_LEAST8_MAXINT_LEAST16_MAXINT_LEAST32_MAXINT_LEAST64_MAX

int_least8_t、int_least16_t、int_least32_t、int_least64_t 类型对象的最大值
(宏常量)

INTPTR_MAX

intptr_t 类型对象的最大值
(宏常量)

INTMAX_MAX

intmax_t 类型对象的最大值
(宏常量)
无符号整数:最大值

UINT8_MAXUINT16_MAXUINT32_MAXUINT64_MAX

uint8_t、uint16_t、uint32_t、uint64_t 类型对象的最大值
(宏常量)

UINT_FAST8_MAXUINT_FAST16_MAXUINT_FAST32_MAXUINT_FAST64_MAX

uint_fast8_t、uint_fast16_t、uint_fast32_t、uint_fast64_t 类型对象的最大值
(宏常量)

UINT_LEAST8_MAXUINT_LEAST16_MAXUINT_LEAST32_MAXUINT_LEAST64_MAX

uint_least8_t、uint_least16_t、uint_least32_t、uint_least64_t 类型对象的最大值
(宏常量)

UINTPTR_MAX

uintptr_t 类型对象的最大值
(宏常量)

UINTMAX_MAX

uintmax_t 类型对象的最大值
(宏常量)

 调用示例

#include <iostream>
#include <cstdint>

int main()
{
    //int8_t、int16_t、int32_t、int64_t 类型对象的最小值
    std::cout << "INT8_MIN:         " << INT8_MIN << std::endl;
    std::cout << "INT16_MIN:        " << INT16_MIN << std::endl;
    std::cout << "INT32_MIN:        " << INT32_MIN << std::endl;
    std::cout << "INT64_MIN:        " << INT64_MIN << std::endl;
    std::cout << std::endl;

    //int_fast8_t、int_fast16_t、int_fast32_t、int_fast64_t 类型对象的最小
    std::cout << "INT_FAST8_MIN:    " << INT_FAST8_MIN << std::endl;
    std::cout << "INT_FAST16_MIN:   " << INT_FAST16_MIN << std::endl;
    std::cout << "INT_FAST32_MIN:   " << INT_FAST32_MIN << std::endl;
    std::cout << "INT_FAST64_MIN:   " << INT_FAST64_MIN << std::endl;
    std::cout << std::endl;

    //int_least8_t、int_least16_t、int_least32_t、int_least64_t 类型对象的最小值
    std::cout << "INT_LEAST8_MIN:   " << INT_LEAST8_MIN << std::endl;
    std::cout << "INT_LEAST16_MIN:  " << INT_LEAST16_MIN << std::endl;
    std::cout << "INT_LEAST32_MIN:  " << INT_LEAST32_MIN << std::endl;
    std::cout << "INT_LEAST64_MIN:  " << INT_LEAST64_MIN << std::endl;
    std::cout << std::endl;

    //int8_t、int16_t、int32_t、int64_t 类型对象的最大值
    std::cout << "INT8_MAX:         " << INT8_MAX << std::endl;
    std::cout << "INT16_MAX:        " << INT16_MAX << std::endl;
    std::cout << "INT32_MAX:        " << INT32_MAX << std::endl;
    std::cout << "INT64_MAX:        " << INT64_MAX << std::endl;
    std::cout << std::endl;

    //int_fast8_t、int_fast16_t、int_fast32_t、int_fast64_t 类型对象的最大值
    std::cout << "INT_FAST8_MAX:    " << INT_FAST8_MAX << std::endl;
    std::cout << "INT_FAST16_MAX:   " << INT_FAST16_MAX << std::endl;
    std::cout << "INT_FAST32_MAX:   " << INT_FAST32_MAX << std::endl;
    std::cout << "INT_FAST64_MAX:   " << INT_FAST64_MAX << std::endl;
    std::cout << std::endl;

    //int_least8_t、int_least16_t、int_least32_t、int_least64_t 类型对象的最大值
    std::cout << "INT_LEAST8_MAX:   " << INT_LEAST8_MAX << std::endl;
    std::cout << "INT_LEAST16_MAX:  " << INT_LEAST16_MAX << std::endl;
    std::cout << "INT_LEAST32_MAX:  " << INT_LEAST32_MAX << std::endl;
    std::cout << "INT_LEAST64_MAX:  " << INT_LEAST64_MAX << std::endl;
    std::cout << std::endl;

    //intptr_t 类型对象的最小值
    std::cout << "INTPTR_MIN:       " << INTPTR_MIN << std::endl;
    //intmax_t 类型对象的最小值
    std::cout << "INTMAX_MIN:       " << INTMAX_MIN << std::endl;
    //intptr_t 类型对象的最大值
    std::cout << "INTPTR_MAX:       " << INTPTR_MAX << std::endl;
    //intmax_t 类型对象的最大值
    std::cout << "INTMAX_MAX:       " << INTMAX_MAX << std::endl;
    std::cout << std::endl;

    //uint8_t、uint16_t、uint32_t、uint64_t 类型对象的最大值
    std::cout << "UINT8_MAX:         " << UINT8_MAX << std::endl;
    std::cout << "UINT16_MAX:        " << UINT16_MAX << std::endl;
    std::cout << "UINT32_MAX:        " << UINT32_MAX << std::endl;
    std::cout << "UINT64_MAX:        " << UINT64_MAX << std::endl;
    std::cout << std::endl;

    //uint_fast8_t、uint_fast16_t、uint_fast32_t、uint_fast64_t 类型对象的最大值
    std::cout << "UINT_FAST8_MAX:    " << UINT_FAST8_MAX << std::endl;
    std::cout << "UINT_FAST16_MAX:   " << UINT_FAST16_MAX << std::endl;
    std::cout << "UINT_FAST32_MAX:   " << UINT_FAST32_MAX << std::endl;
    std::cout << "UINT_FAST64_MAX:   " << UINT_FAST64_MAX << std::endl;
    std::cout << std::endl;

    //uint_least8_t、uint_least16_t、uint_least32_t、uint_least64_t 类型对象的最大值
    std::cout << "UINT_LEAST8_MAX:   " << UINT_LEAST8_MAX << std::endl;
    std::cout << "UINT_LEAST16_MAX:  " << UINT_LEAST16_MAX << std::endl;
    std::cout << "UINT_LEAST32_MAX:  " << UINT_LEAST32_MAX << std::endl;
    std::cout << "UINT_LEAST64_MAX:  " << UINT_LEAST64_MAX << std::endl;
    std::cout << std::endl;

    //uintptr_t 类型对象的最大值
    std::cout << "UINTPTR_MAX:       " << UINTPTR_MAX << std::endl;
    //uintmax_t 类型对象的最大值
    std::cout << "UINTMAX_MAX:       " << UINTMAX_MAX << std::endl;
    std::cout << std::endl;
    return 0;
}

输出

INT8_MIN:         -128
INT16_MIN:        -32768
INT32_MIN:        -2147483648
INT64_MIN:        -9223372036854775808

INT_FAST8_MIN:    -128
INT_FAST16_MIN:   -32768
INT_FAST32_MIN:   -2147483648
INT_FAST64_MIN:   -9223372036854775808

INT_LEAST8_MIN:   -128
INT_LEAST16_MIN:  -32768
INT_LEAST32_MIN:  -2147483648
INT_LEAST64_MIN:  -9223372036854775808

INT8_MAX:         127
INT16_MAX:        32767
INT32_MAX:        2147483647
INT64_MAX:        9223372036854775807

INT_FAST8_MAX:    127
INT_FAST16_MAX:   32767
INT_FAST32_MAX:   2147483647
INT_FAST64_MAX:   9223372036854775807

INT_LEAST8_MAX:   127
INT_LEAST16_MAX:  32767
INT_LEAST32_MAX:  2147483647
INT_LEAST64_MAX:  9223372036854775807

INTPTR_MIN:       -2147483648
INTMAX_MIN:       -9223372036854775808
INTPTR_MAX:       2147483647
INTMAX_MAX:       9223372036854775807

UINT8_MAX:         255
UINT16_MAX:        65535
UINT32_MAX:        4294967295
UINT64_MAX:        18446744073709551615

UINT_FAST8_MAX:    255
UINT_FAST16_MAX:   65535
UINT_FAST32_MAX:   4294967295
UINT_FAST64_MAX:   18446744073709551615

UINT_LEAST8_MAX:   255
UINT_LEAST16_MAX:  65535
UINT_LEAST32_MAX:  4294967295
UINT_LEAST64_MAX:  18446744073709551615

UINTPTR_MAX:       4294967295
UINTMAX_MAX:       18446744073709551615

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Twitter Digg Facebook Del.icio.us Reddit Stumbleupon Newsvine Technorati Mr. Wong Yahoo! Google Windows Live Send as Email Add to your CodeProject bookmarks Discuss this article 85 Print Article Database » Database » Other databasesLicence CPOL First Posted 19 Jan 2012 Views 24,219 Downloads 992 Bookmarked 74 times RaptorDB - The Key Value Store V2 By Mehdi Gholam | 8 Mar 2012 | Unedited contribution C#.NETDBABeginnerIntermediateAdvanceddatabase Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. See Also More like this More by this author Article Browse Code Stats Revisions (8) Alternatives 4.95 (56 votes) 1 2 3 4 5 4.95/5 - 56 votes μ 4.95, σa 1.05 [?] Is your email address OK? You are signed up for our newsletters but your email address is either unconfirmed, or has not been reconfirmed in a long time. Please click here to have a confirmation email sent so we can confirm your email address and start sending you newsletters again. Alternatively, you can update your subscriptions. Add your own alternative version Introduction What is RaptorDB? Features Why another data structure? The problem with a b+tree Requirements of a good index structure The MGIndex Page Splits Interesting side effects of MGIndex The road not taken / the road taken and doubled back! Performance Tests Comparing B+tree and MGIndex Really big data sets! Index parameter tuning Performance Tests - v2.3 Using the Code Differences to v1 Using RaptorDBString and RaptorDBGuid Global parameters RaptorDB interface Non-clean shutdowns Removing Keys Unit tests File Formats File Format : *.mgdat File Format : *.mgbmp File Format : *.mgidx File Format : *.mgbmr , *.mgrec History Download RaptorDB_v2.0.zip - 38.7 KB Download RaptorDB_v2.1.zip - 39 KB Download RaptorDB_v2.2.zip - 39 KB Download RaptorDB_v2.3.zip - 39.6 KB D
听说这个有用 The following are typedefs of fundamental integral types or extended integral types. signed type unsigned type description intmax_t uintmax_t Integer type with the maximum width supported. int8_t uint8_t Integer type with a width of exactly 8, 16, 32, or 64 bits. For signed types, negative values are represented using 2's complement. No padding bits. Optional: These typedefs are not defined if no types with such characteristics exist.* int16_t uint16_t int32_t uint32_t int64_t uint64_t int_least8_t uint_least8_t Integer type with a minimum of 8, 16, 32, or 64 bits. No other integer type exists with lesser size and at least the specified width. int_least16_t uint_least16_t int_least32_t uint_least32_t int_least64_t uint_least64_t int_fast8_t uint_fast8_t Integer type with a minimum of 8, 16, 32, or 64 bits. At least as fast as any other integer type with at least the specified width. int_fast16_t uint_fast16_t int_fast32_t uint_fast32_t int_fast64_t uint_fast64_t intptr_t uintptr_t Integer type capable of holding a value converted from a void pointer and then be converted back to that type with a value that compares equal to the original pointer. Optional: These typedefs may not be defined in some library implementations.* Some of these typedefs may denote the same types. Therefore, function overloads should not rely on these being different. * Notice that some types are optional (and thus, with no portability guarantees). A particular library implementation may also define additional types with other widths supported by its system. In any case, if either the signed or the unsigned version is defined, both the signed and unsigned versions are defined.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值