Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I declared my variables as unsigned long long int and I have also changed the return type to this. It worked.
I just tried it, there are no issues.
It's a wrong assumption that
long
is always 32 bits.long
is not less thanint
and not less than 32 bits. In 64-bit Linux it's 64 bits.You are probably converting to
unsigned long
when it's too late and the result is already truncated (at best; or even more likely undefined).I tried to change the function to unsigned long but I get the same error.
And what's the message now? VS C++ uses 32 bit, but here it's 64 bit... and there are better ways to force 64 bits on different platforms? Many comments for a small solution of a simple kata. Fact is, there's no overflow here and no VS C++;-)!
It's a "long" which has 8 Byte or 64 Bit, try sizeof(m) which is 8... so there's no problem, because all the others are only int.