UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » adding 2 64 bit numbers on a 32 bit machine

#1 2009-03-18 01:20 PM

rvan
Member
Registered: 2009-02-27
Posts: 13

Re: adding 2 64 bit numbers on a 32 bit machine

Hi All,

Is it possible to add 2 64 bit numbers on a 32 bit machine. If yes how?

can someone explain me this?

Thanks in advance

Offline

#2 2009-03-18 02:57 PM

jfriesne
Administrator
From: California
Registered: 2005-07-06
Posts: 348
Website

Re: adding 2 64 bit numbers on a 32 bit machine

Offline

#3 2009-03-18 03:55 PM

rvan
Member
Registered: 2009-02-27
Posts: 13

Re: adding 2 64 bit numbers on a 32 bit machine

Thanks for your reply.

Assume that internally it won't happen for us and we need to write the logic to add 2 64 bit integers in a 32 bit machine.

Offline

#4 2009-03-18 07:01 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: adding 2 64 bit numbers on a 32 bit machine

Just do two 32 bit adds, but before doing the upper halves, add the carry.

Offline

#5 2009-09-16 04:52 PM

rsgoldrsgolds
Guest

Re: adding 2 64 bit numbers on a 32 bit machine

  • Index
  • » C
  • » adding 2 64 bit numbers on a 32 bit machine

Board footer

Powered by FluxBB