LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-13-2006, 11:53 PM   #1
rajesh_b
Member
 
Registered: Sep 2004
Location: Hyderabad.
Posts: 83

Rep: Reputation: 15
Question 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
 
Old 09-14-2006, 09:35 AM   #2
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
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.
 
Old 09-14-2006, 11:03 PM   #3
rajesh_b
Member
 
Registered: Sep 2004
Location: Hyderabad.
Posts: 83

Original Poster
Rep: Reputation: 15
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.
 
Old 09-15-2006, 09:03 AM   #4
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sequence of numbers, how to extract which numbers are missing jonlake Programming 13 06-26-2006 03:28 AM
32 bit or 64 bit install - is 32 bit easier for a newbie? dms05 Linux - Newbie 3 05-19-2006 03:05 PM
Adding numbers, break on non-numbers... Cruger Programming 1 03-22-2004 09:18 AM
C, read 8 bit octal numbers, convert to 24 bit binary bamalabs Programming 3 01-20-2004 09:59 AM
Graphic Card that Supports displaying 8-bit and 24-bit images simultaneously yrraja Linux - Hardware 2 04-30-2003 06:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration