I need to bruteforce a year for an exercise. The compiler keep throwing this error:
bruteforceJS12.cpp:8:28: warning: integer constant is too large fo
Your problem is simply that 318338237039211050000ULL
is out of range.
Assuming a 64 bit type, a 64 bit value is good for log10( 264-1) decimal digits (i.e. all 19 digit values and some lower 20 digit values), 318338237039211050000ull
has 21 digits. 264-1 (18446744073709551615ull
) is the maximum.
The value 318338237039211050000 requires at least log10(318338237039211050000)/log10(2) bits. That's 69 bits.