Re: 64 bit division ..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 13, 2005 at 23:05:57 +0100, Jesper Juhl wrote:
> On 12/13/05, ppunnam@xxxxxxxxxxx <ppunnam@xxxxxxxxxxx> wrote:
> >
> >
> >  Hi,
> >       can any one tell me how can we caluculate the 64 bit division in
> > user space. I got two __u64 variables, something similar to the
> > do_div (asm/div64.h) in kernel.
> >
> 
> Just do a normal division. If you are using a 64bit architecture with
> a 64bit userspace / compiler / toolchain and doing divisions on 64bit
> long types, then your compiler should take care of generating the
> proper 64bit div's all on its own.

You don't have to be on a 64-bit architecture nor use 64-bit userspace.
You just need a compiler that supports 64-bit integeral type. Then
simply use / (but make sure both operands and result are 64-bit).

-- 
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux