Init
This commit is contained in:
65
cppdraft/support/arith/types.md
Normal file
65
cppdraft/support/arith/types.md
Normal file
@@ -0,0 +1,65 @@
|
||||
[support.arith.types]
|
||||
|
||||
# 17 Language support library [[support]](./#support)
|
||||
|
||||
## 17.4 Arithmetic types [support.arith.types]
|
||||
|
||||
### [17.4.1](#cstdint.syn) Header <cstdint> synopsis [[cstdint.syn]](cstdint.syn)
|
||||
|
||||
[1](#cstdint.syn-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L1880)
|
||||
|
||||
The header [<cstdint>](#header:%3ccstdint%3e "17.4.1 Header <cstdint> synopsis [cstdint.syn]") supplies integer types having specified widths, and
|
||||
macros that specify limits of integer types[.](#cstdint.syn-1.sentence-1)
|
||||
|
||||
[ð](#header:%3ccstdint%3e)
|
||||
|
||||
// all freestanding#define __STDC_VERSION_STDINT_H__ 202311Lnamespace std {using int8_t = *signed integer type*; // optionalusing int16_t = *signed integer type*; // optionalusing int32_t = *signed integer type*; // optionalusing int64_t = *signed integer type*; // optionalusing int*N*_t = *see below*; // optionalusing int_fast8_t = *signed integer type*; using int_fast16_t = *signed integer type*; using int_fast32_t = *signed integer type*; using int_fast64_t = *signed integer type*; using int_fast*N*_t = *see below*; // optionalusing int_least8_t = *signed integer type*; using int_least16_t = *signed integer type*; using int_least32_t = *signed integer type*; using int_least64_t = *signed integer type*; using int_least*N*_t = *see below*; // optionalusing intmax_t = *signed integer type*; using intptr_t = *signed integer type*; // optionalusing uint8_t = *unsigned integer type*; // optionalusing uint16_t = *unsigned integer type*; // optionalusing uint32_t = *unsigned integer type*; // optionalusing uint64_t = *unsigned integer type*; // optionalusing uint*N*_t = *see below*; // optionalusing uint_fast8_t = *unsigned integer type*; using uint_fast16_t = *unsigned integer type*; using uint_fast32_t = *unsigned integer type*; using uint_fast64_t = *unsigned integer type*; using uint_fast*N*_t = *see below*; // optionalusing uint_least8_t = *unsigned integer type*; using uint_least16_t = *unsigned integer type*; using uint_least32_t = *unsigned integer type*; using uint_least64_t = *unsigned integer type*; using uint_least*N*_t = *see below*; // optionalusing uintmax_t = *unsigned integer type*; using uintptr_t = *unsigned integer type*; // optional}#define INT*N*_MIN *see below*#define INT*N*_MAX *see below*#define UINT*N*_MAX *see below*#define INT*N*_WIDTH *see below*#define UINT*N*_WIDTH *see below*#define INT_FAST*N*_MIN *see below*#define INT_FAST*N*_MAX *see below*#define UINT_FAST*N*_MAX *see below*#define INT_FAST*N*_WIDTH *see below*#define UINT_FAST*N*_WIDTH *see below*#define INT_LEAST*N*_MIN *see below*#define INT_LEAST*N*_MAX *see below*#define UINT_LEAST*N*_MAX *see below*#define INT_LEAST*N*_WIDTH *see below*#define UINT_LEAST*N*_WIDTH *see below*#define INTMAX_MIN *see below*#define INTMAX_MAX *see below*#define UINTMAX_MAX *see below*#define INTMAX_WIDTH *see below*#define UINTMAX_WIDTH *see below*#define INTPTR_MIN *see below* // optional#define INTPTR_MAX *see below* // optional#define UINTPTR_MAX *see below* // optional#define INTPTR_WIDTH *see below* // optional#define UINTPTR_WIDTH *see below* // optional#define PTRDIFF_MIN *see below*#define PTRDIFF_MAX *see below*#define PTRDIFF_WIDTH *see below*#define SIZE_MAX *see below*#define SIZE_WIDTH *see below*#define SIG_ATOMIC_MIN *see below*#define SIG_ATOMIC_MAX *see below*#define SIG_ATOMIC_WIDTH *see below*#define WCHAR_MIN *see below*#define WCHAR_MAX *see below*#define WCHAR_WIDTH *see below*#define WINT_MIN *see below*#define WINT_MAX *see below*#define WINT_WIDTH *see below*#define INT*N*_C(value) *see below*#define UINT*N*_C(value) *see below*#define INTMAX_C(value) *see below*#define UINTMAX_C(value) *see below*
|
||||
|
||||
[2](#cstdint.syn-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L2044)
|
||||
|
||||
The header defines all types and macros the same as
|
||||
the C standard library header [<stdint.h>](support.c.headers.general#header:%3cstdint.h%3e "17.15.1 General [support.c.headers.general]")[.](#cstdint.syn-2.sentence-1)
|
||||
|
||||
The types denoted by intmax_t and uintmax_t are not required to be able to represent all values of extended integer types
|
||||
wider than long long and unsigned long long, respectively[.](#cstdint.syn-2.sentence-2)
|
||||
|
||||
See also: ISO/IEC 9899:2024, 7.22
|
||||
|
||||
[3](#cstdint.syn-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L2053)
|
||||
|
||||
All types that use the placeholder *N* are optional when *N* is not 8, 16, 32, or 64[.](#cstdint.syn-3.sentence-1)
|
||||
|
||||
The exact-width typesint*N*_t and uint*N*_t for *N* = 8, 16, 32, and 64 are also optional;
|
||||
however, if an implementation defines integer types
|
||||
with the corresponding width and no padding bits,
|
||||
it defines the corresponding [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4 The typedef specifier [dcl.typedef]")*s*[.](#cstdint.syn-3.sentence-2)
|
||||
|
||||
Each of the macros listed in this subclause
|
||||
is defined if and only if
|
||||
the implementation defines the corresponding [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4 The typedef specifier [dcl.typedef]")[.](#cstdint.syn-3.sentence-3)
|
||||
|
||||
[*Note [1](#cstdint.syn-note-1)*:
|
||||
|
||||
The macros INT*N*_C and UINT*N*_C correspond to the [*typedef-name*](dcl.typedef#nt:typedef-name "9.2.4 The typedef specifier [dcl.typedef]")*s*int_least*N*_t and uint_least*N*_t,
|
||||
respectively[.](#cstdint.syn-3.sentence-4)
|
||||
|
||||
â *end note*]
|
||||
|
||||
### [17.4.2](#stdfloat.syn) Header <stdfloat> synopsis [[stdfloat.syn]](stdfloat.syn)
|
||||
|
||||
[1](#stdfloat.syn-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L2076)
|
||||
|
||||
The header [<stdfloat>](#header:%3cstdfloat%3e "17.4.2 Header <stdfloat> synopsis [stdfloat.syn]") defines type aliases for
|
||||
the optional extended floating-point types that are specified in[[basic.extended.fp]](basic.extended.fp "6.9.3 Optional extended floating-point types")[.](#stdfloat.syn-1.sentence-1)
|
||||
|
||||
[ð](#header:%3cstdfloat%3e)
|
||||
|
||||
namespace std {#if defined(__STDCPP_FLOAT16_T__)using float16_t = *implementation-defined*; // see [[basic.extended.fp]](basic.extended.fp "6.9.3 Optional extended floating-point types")#endif#if defined(__STDCPP_FLOAT32_T__)using float32_t = *implementation-defined*; // see [[basic.extended.fp]](basic.extended.fp "6.9.3 Optional extended floating-point types")#endif#if defined(__STDCPP_FLOAT64_T__)using float64_t = *implementation-defined*; // see [[basic.extended.fp]](basic.extended.fp "6.9.3 Optional extended floating-point types")#endif#if defined(__STDCPP_FLOAT128_T__)using float128_t = *implementation-defined*; // see [[basic.extended.fp]](basic.extended.fp "6.9.3 Optional extended floating-point types")#endif#if defined(__STDCPP_BFLOAT16_T__)using bfloat16_t = *implementation-defined*; // see [[basic.extended.fp]](basic.extended.fp "6.9.3 Optional extended floating-point types")#endif}
|
||||
Reference in New Issue
Block a user