I wrote simple C++/CLI code to calculate a result of big integer numbers operation, but it failed with the warning warning C4307: '*' : integral constant overflow, here is my code:
int main(array<System::String ^> ^args)
{
String^ number = gcnew String((wchar_t *)(28433 * (2 ^ 7830457) + 1));
Console::WriteLine(number);
return 0;
}
You have a number of fundamental misunderstandings in your code:
^is xor, and not exponentiation.You should use the
BigIntegerstruct fromSystem.Numerics. Don’t forget to add the assembly reference toSystem.Numerics.dllfirst.