LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   manipulating 64 bit numbers using 32 bit numbers. (https://www.linuxquestions.org/questions/programming-9/manipulating-64-bit-numbers-using-32-bit-numbers-483317/)

rajesh_b 09-13-2006 11:53 PM

manipulating 64 bit numbers using 32 bit numbers.
 
hi,
Can any body tell me how can i represent, manipulate ( add, subtraction )64 bit numbers using 32 bit integers. My system environment does not support 64 bit one's. I have googled and i didnt find any thing.
Thanks in advance.


Regards,
Rajesh

Quigi 09-14-2006 09:35 AM

Tell us more about your environment.

Many languages will take care of this for you; you might have a type long long or something like that and not further worry about it. Otherwise chances are there's a "big number" package ready that you can use.
It's not actually that complicated. If you're talking assembly, to add you'd first add the two low words, which potentially sets the carry flag, and then you add-with-carry the two high words.

rajesh_b 09-14-2006 11:03 PM

hi
 
Thanks for the reply.
I know that i can use long long in gcc and _int64 in visual studio. But my current compiler does not have support for 64 bit data types.
What is my problem is i want to store a 64 bit value in a file and read it, manipulate it later time.

Rajesh.

Quigi 09-15-2006 09:03 AM

OK, you disclosed there's a compiler, and you want to store data in a file. Can you tell us more? What are you trying to do? In which programming language?


All times are GMT -5. The time now is 08:42 AM.