C data types (redirect from Stdint.h)
All new types are defined in <inttypes.h> header (cinttypes header in C++) and also are available at <stdint.h> header (cstdint header in C++). The types...
33 KB (3,252 words) - 20:01, 23 July 2024
Both give a maximum-length sequence. An example in C is below: #include <stdint.h> unsigned lfsr_fib(void) { uint16_t start_state = 0xACE1u; /* Any nonzero...
37 KB (4,672 words) - 10:41, 22 June 2024
use three shifts and three or four exclusive-or operations: #include <stdint.h> struct xorshift32_state { uint32_t a; }; /* The state must be initialized...
23 KB (2,831 words) - 09:43, 6 August 2024
C standard library (redirect from Stdlib.h)
ratified in 1995. Six more header files (complex.h, fenv.h, inttypes.h, stdbool.h, stdint.h, and tgmath.h) were added with C99, a revision to the C Standard...
29 KB (2,875 words) - 23:17, 26 March 2024
64-bit pointers and 32-bit integers. This issue is resolved by C99 in stdint.h in the form of intptr_t. The bitness of a program may refer to the word...
30 KB (2,450 words) - 03:15, 24 July 2024
In the C and C++ programming languages, unistd.h is the name of the header file that provides access to the POSIX operating system API. It is defined...
13 KB (302 words) - 13:12, 9 February 2024
to the standard math.h functions for use on Q16.16 fixed-point numbers. libfixmath has no external dependencies other than stdint.h and a compiler which...
5 KB (210 words) - 14:40, 17 January 2023
decoder in the C programming language: #include <stddef.h> #include <stdint.h> #include <assert.h> /** COBS encode data to buffer @param data Pointer to...
12 KB (1,513 words) - 19:04, 30 April 2024
Rijndael S-box). The following C code calculates the S-box: #include <stdint.h> #define ROTL8(x,shift) ((uint8_t) ((x) << (shift)) | ((x) >> (8 - (shift))))...
11 KB (1,247 words) - 07:33, 26 July 2024
1812433253. The value for f for MT19937-64 is 6364136223846793005. #include <stdint.h> #define n 624 #define m 397 #define w 32 #define r 31 #define UMASK (0xffffffffUL...
32 KB (4,013 words) - 03:10, 28 June 2024
restrict keyword Several new library headers, including stdint.h, <tgmath.h>, fenv.h, <complex.h> Improved compatibility with several C++ features, including...
18 KB (1,775 words) - 10:16, 1 August 2024
C dynamic memory allocation (redirect from Alloc.h)
C99 standard and later, it is available as the SIZE_MAX constant from <stdint.h>. Although not guaranteed by ISO C, it is usually 2^(CHAR_BIT * sizeof(size_t))...
35 KB (4,126 words) - 13:51, 7 April 2024
13, 14) // row 4 An implementation in C/C++ appears below. #include <stdint.h> #define ROTL(a,b) (((a) << (b)) | ((a) >> (32 - (b)))) #define QR(a, b...
31 KB (3,574 words) - 01:57, 24 July 2024
"PRBS-7" sequence can be expressed in C as #include <stdio.h> #include <stdint.h> #include <stdlib.h> int main(int argc, char* argv[]) { uint8_t start = 0x02;...
8 KB (1,064 words) - 16:26, 5 February 2024
punning through a union is also undefined behavior in C++. # include <stdint.h> // uint32_t float Q_rsqrt(float number) { union { float f; uint32_t i;...
34 KB (4,533 words) - 20:42, 30 July 2024
unsigned int. */ #include <stdint.h> // for uint32_t, to get 32-bit-wide rotates, regardless of the size of int. #include <limits.h> // for CHAR_BIT uint32_t...
9 KB (986 words) - 16:50, 20 July 2024
<pthread.h> <setjmp.h> <signal.h> <stdarg.h> <stdbool.h> <stddef.h> <stdint.h> <stdio.h> <stdlib.h> <string.h> <sys/stat.h> <tgmath.h> <time.h> <unistd.h> <utime...
10 KB (135 words) - 13:36, 1 August 2024
instead. An example of both modulo and masking in C: #include <stdint.h> #include <string.h> int main(void) { const uint32_t NUM_BUCKETS = 0xFFFFFFFF; //...
12 KB (1,736 words) - 16:00, 22 March 2024
first but not the second optimization: #include <stdlib.h> /* for size_t */ #include <stdint.h> /* for uint8_t, uint16_t & uint32_t */ uint16_t fletcher16(const...
18 KB (2,590 words) - 12:57, 20 October 2023
bits within one (or more) computer words. Here shown in C++: #include <stdint.h> #include <iostream> int main() { uint64_t state = 1u << 31; for (int i...
14 KB (1,619 words) - 22:29, 22 April 2024
with 64-bit state and 32-bit output. It can be implemented as: #include <stdint.h> static uint64_t state = 0x4d595df4d0f33173; // Or something seed-dependent...
12 KB (1,617 words) - 09:10, 8 February 2024
width, programmers can and should use typedefs from the standard header stdint.h. Integer constants may be specified in source code in several ways. Numeric...
76 KB (9,824 words) - 22:35, 3 June 2024
is in the IEEE 754 single precision floating point format */ #include <stdint.h> float sqrt_approx(float z) { union { float f; uint32_t i; } val = {z};...
69 KB (11,849 words) - 15:26, 30 June 2024
of the function it is in. Headers: cstdbool (stdbool.h), cstdint (stdint.h), cinttypes (inttypes.h). Heading for a separate TR: Modules Decimal types Math...
102 KB (13,106 words) - 00:48, 3 July 2024
released into the public domain by David Wheeler and Roger Needham: #include <stdint.h> void encrypt (uint32_t v[2], const uint32_t k[4]) { uint32_t v0=v[0],...
13 KB (1,189 words) - 18:51, 14 April 2024
shift return matches #include <stdint.h> #include <stddef.h> #include <stdbool.h> #include <stdlib.h> #include <unistd.h> #define ALPHABET_LEN 256 #define...
37 KB (5,059 words) - 17:07, 5 August 2024
be large enough, C99 specifies the uintptr_t typedef name defined in <stdint.h>, but an implementation need not provide it. C++ fully supports C pointers...
73 KB (9,782 words) - 23:19, 3 June 2024
the Cypherpunk mailing list. /* Red Pike cipher source code */ #include <stdint.h> typedef uint32_t word; #define CONST 0x9E3779B9 #define ROUNDS 16 #define...
3 KB (427 words) - 18:50, 14 April 2024
Wheeler and Roger Needham, encrypts and decrypts using XTEA: #include <stdint.h> /* take 64 bits of data in v[0] and v[1] and 128 bits of key[0] - key[3]...
10 KB (1,005 words) - 19:00, 14 April 2024
required for the higher multiples. This would be the routine in C: #include <stdint.h> uint64_t multiply(uint64_t ab, uint64_t cd) { /* These shifts and masks...
12 KB (1,514 words) - 17:46, 3 July 2024