The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> C Programming
|
"long long long" too long?
Discuss "long long long" too long? in the C Programming forum on Dev Shed. "long long long" too long? C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 27th, 2012, 10:15 AM
|
|
Contributing User
|
|
Join Date: Dec 2012
Posts: 52
 
Time spent in forums: 14 h 36 m 53 sec
Reputation Power: 1
|
|
|
"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, 10:35 AM
|
 |
Contributed User
|
|
|
|
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.
click me
|

December 27th, 2012, 11:21 AM
|
|
Contributing User
|
|
Join Date: Dec 2012
Posts: 52
 
Time spent in forums: 14 h 36 m 53 sec
Reputation Power: 1
|
|
Quote: | Originally Posted by salem 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.
click me |
I'm on windows 7 64 bit.
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, 11:42 AM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
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
|

December 27th, 2012, 12:15 PM
|
|
Contributing User
|
|
Join Date: Dec 2012
Posts: 52
 
Time spent in forums: 14 h 36 m 53 sec
Reputation Power: 1
|
|
Quote: | Originally Posted by Scorpions4ever 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. |
int64_t doesnt work for 19 digit number...
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 :
http://en.wikipedia.org/wiki/Integer_(computer_science)
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, 01:30 AM
|
|
Registered User
|
|
Join Date: Aug 2012
Posts: 56
Time spent in forums: 15 h 12 m 50 sec
Reputation Power: 0
|
|
|
try convert it into string ...
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|