Article View: comp.std.c
Article #447964bit Int routines
From: Adam Nash
Date: Fri, 15 Dec 1995 00:04
Date: Fri, 15 Dec 1995 00:04
27 lines
1158 bytes
1158 bytes
Sorry if this is the wrong group, but is there some common library of
routines to manipulate 64-bit ints on a machine that only supports 32bit
ints native? ie, I have these "wides" that are a
typedef struct {
long hi;
unsigned long lo;
} wide;
I have routines (easily written myself) for addition, subtraction, negate,
and conversion to and from longs.
I need routines for bitshift, multiply, and divide.
Multiply should take two longs and return a wide. Divide should divide
a long into a wide, and bitshift should be able to shift a wide n bits,
either way (+ for right, - for left)
So, is there any refined code out there? Something new for the standard?
-Adam
--
Adam Nash
CS 108 TA
adamnash@cs.stanford.edu
http://www-leland.stanford.edu/~smashman
Stanford University - Computer Science
Technical Details
Message-ID:
<adamnash-1412951604220001@gel.stanford.edu>Path:
arc1-ca.pugleaf.net!gel.stanford.edu!userShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!gel.stanford.edu!user From: adamnash@cs.stanford.edu (Adam Nash) Newsgroups: comp.std.c Subject: 64bit Int routines Date: Thu, 14 Dec 1995 16:04:22 -0800 Organization: Computer Science, Stanford University Message-ID: <adamnash-1412951604220001@gel.stanford.edu> NNTP-Posting-Host: gel.stanford.edu