Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Name: Leo the 28C (by Sulfurik)
Hello everyone!
Hey... I need to handle big numbers (several gigabytes) in C (must be plain ol' C, no C++ or anything), but 32-bit integers can't handle that... The long long type of C99 (I need C89, so that's not a choice, but I tried it anyways...) doesn't work either... Does anyone know any way to do this? Thanks!-- Leo

I dunno C, but that homepage link sounds interesting. BUT it didn't load.
http://tsfc.ath.cx/
this:
http://ath.cx/
takes me to dynDNS
If at first you don't succeed, you're about average.M2

It might be kind of a pain, but you could try using two 32-bit integers to represent one number, and concatinate them. I'm not that familiar with C, but if you did it this way, you would have to be careful while making calculations.
~Ben;

you can try to make an abstract data type, but you have to make each function for the +, -, * and / operator.
by using ADT you can make limitless integer.Athlon 64 2800+ @ 2.63 Ghz Stock Cooling
Timings:2-3-2-5
V-Gen 512MB pc3200 x 2
DFI Lanparty UT NF3
Abit R9550 VGuru XTurbo
525Mhz/300Mhz

01-08-2006
------ POINT 1
From http://blogs.msdn.com/calvin_hsia/archive/2005/03/18/398749.aspxLONG is a 32 bit quantity, whereas LARGE_INTEGER is defined in Winnt.H as a Union
typedef union _LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
};
struct {
DWORD LowPart;
LONG HighPart;
} u;
LONGLONG QuadPart;
} LARGE_INTEGER;
typedef LARGE_INTEGER *PLARGE_INTEGER;
The HighPart is 32 bit signed and the LowPart is 32 bit unsigned. Put them together and you have a 64 bit signed number....------ POINT 2
[in the mingw32 distribution 3.4.4see winnt.h
see largeint.h for LargeIntegerAdd (LARGE_INTEGER ,LARGE_INTEGER )]
I hope this will help you.
P.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |