hmm well i have a variable long long and i want to assign some big numbers to it. something like:
v=a*a*a;
i know that the value definately fits in long long v, but it is bigger than a standard integer. this has occured to me on a number of occasions
it wont even let me use something like v=10000000000000;
Last edited by bugzpodder on Sat Sep 20, 2003 3:46 am, edited 1 time in total.
If "a" is not of the "long long" type, you need to explicitly cast it. Else, it'll do the arithmetic using that type, and then convert to "long long" when done.
And if you want to do an assignment of an explicit number, you can write v = 12345LL; (or 12345ULL if the number is >= 2^63).
(But of course, if the number is small enough to fit in an int, you don't need the LL suffix as the number, having been parsed correctly as an int, will be promoted to long long anyway.)