[ back to toc ]

data type question

Date: 2002/05/31 17:30

Q:
Hi, i am trying to input a 13 digit number into a file. need to know that
data type can i use to capture this long integer number??
I have tried using (unsigned long int), but this only take in 10 digits,
is there any other type that can take in 13 digits?? please advice. thank
you.

A:
You can store arbitrary long 'numbers' as characters. Other than that
there is no C type that can store very big numbers. However as others face
the same issue sometimes, there are libraries that provide compound
structures to store huge numbers and functions to perform operation on
those.

I recommend the GNU APM (arbitrary precision mathematics) library.

Regards,
Peter

[ back to toc ]