devxlogo

64-bit integer support

64-bit integer support

Question:
How can I support 64-bit integers on a 32-bit system? I need to do division on numbers exceeding 4.3 billion. I have the resaults in a char value, and would like to convert the value to a 64-bit integer, if possible. If not, do you know of a way to translate the resault of a float division into a more human readable format?

Answer:
As with so many questions I see here, this depends on your compiler, which you didn’t specify.

If, like me, you are using Visual C++, you can declare a 64-bit integer like this:

__int64 i;

Some systems use this:

long long i;

You’ll need to refer to your compiler’s documentation to determine if this is something it supports.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist