December 27th, 2012, 11:15 AM
"long long long" too long?
I have a problem that "long long long" is too long for GCC .
I can't use a 64-bit integer in codeblocks?
how do I use a 64-bit integer in codeblocks...? Is it possible??
December 27th, 2012, 11:35 AM
Yes, you can use a long long in code::blocks (with gcc), but if you're on windows, then you need to use the microsoft specific format for long longs.
December 27th, 2012, 12:21 PM
I'm on windows 7 64 bit.
Originally Posted by salem
And didn't quite understand what you said about microsoft specific format...looked into the page, couldn't understand it.
I want to use numbers bigger than (+-)2 billion something which is possible with 32bits...
and I am able to use "long long" already. I need "long long long" (3x "long").
December 27th, 2012, 12:42 PM
There isn't any official type called long long long in C or C++. However there are some multiple precision libraries that let you compute to arbitrary precisions (subject to how much RAM you have in your computer). One such library is GNU MP Bignum library. See if that helps you out or google for "multiple precision library" to see other libraries (MPIR is another one).
Whoops, just noticed you wanted a 64 bit integer. Try #include <stdint.h> and declare your type as u64_t or i64_t for unsigned int or int.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
December 27th, 2012, 01:15 PM
int64_t doesnt work for 19 digit number...
Originally Posted by Scorpions4ever
I tested it for all numbers from 20 to 10 digit. 10 digit worked(the number I entered was 1 billion something which is in range of 32bit numbers).
And the triple long or "long long long", I found here :
And codeblocks seems to recognize "long long long" but gives an error that : "long long long is too long for gcc blah blah..."
December 28th, 2012, 02:30 AM
try convert it into string ...