Answer the question
In order to leave comments, you need to log in
How to use stdint.h?
In general, I had a problem, I didn’t know how to save very large numbers (they needed them for encryption).
And so I found the stdint.h library by chance . The following types are defined there:
The largest uint_fast64_t = 2^64-1
2^64
I tried to do something with it:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main(void)
{
uint_fast64_t number = 18446744073709551615;
printf("%d\n",number);
system("pause");
return 0;
}
C:\Users\Егор\Desktop>gcc -std=c11 verybigint.c
verybigint.c: In function 'main':
verybigint.c:7:25: warning: integer constant is too large for its type
uint_fast64_t number = 18446744073709551615;
^
Answer the question
In order to leave comments, you need to log in
For crypto, if you want to touch the handles - either BigDigits, everything you need is there (simplicity check, exponentiation, working with very large numbers, etc.)
www.di-mgt.com.au/bigdigits.html
according to your question - your number is incorrect
184467440737095511615
18446744073709551615 <-- correct
(I'm flattered, or has the number changed to the correct one in the question?)
and you can use the type unsigned long long
unsigned long long number = 18446744073709551615; //I compile flawlessly
IMHO, it's easier in hexadecimal:
unsigned long long number = 0xFFFFFFFFFFFFFF;
uint_fast64_t number = 184467440737095511615;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question