Cell Relay Archive

Cell Relay Retreat>List Archive>month:1997-Jan> msg00197



[Date Prev][Date Next][Thread Prev][Thread Next]  
  [Date Index][Thread Index][Author Index][Subject Index]

Re: Help

  • From: Vinay Bannai <vinay@agni.nuko.com>
  • Date: Fri, 24 Jan 1997 18:16:26 -0800

Douglas Jardin wrote:
> 
> Hi all,
> 
> Does any of you mathematical wizards know of a mechanism to
> multiply two unsigned 32 bit numbers taking care of the overflow.
> What I would like to have is basically
> 
>         U321      (First unsigned 32 bit number)
>         U322      (Second unsigned 32 bit number)
> 
>         result = U32-1 * U32-2
> 
>         result here can be an array of two 32 bit entries holding
> the result of the multiplication. Let me tell you that I dont want
> to use any floating point arithematic.
> 
>         Any suggestions and references to books on numerical
> computations will be appreciated.
> 
> Thanx,
> Douglas.

If you are using gcc, it will let you declare a variable as
long long x;  (64 bits)

I am not sure whether it is availabe on all platforms. It is definitely
on all sun machines runing sunOS and pc's with freebsd..

that way you don't have to deal with arrays and messy overflow
situations...

Vinay
-- 
Vinay Bannai                     E-mail: vinay@agni.nuko.com
(408)-526-0280 x 275 (Work)     http://agni.nuko.com/~vinay


  • Follow-Ups:
    • Re: Help
      • From: Tony Przygienda <prz@fore.com>