Search:
Forum
General C++ Programming
Making custom-sized ints?
Making custom-sized ints?
Aug 14, 2009 at 7:22pm UTC
Yuan
(4)
Hello all.
How do I make custom-sized ints/doubles/etc., such as 42-bit ints, instead of the standard 32-bit ones?
Thanks!
~Yuan
Aug 14, 2009 at 8:22pm UTC
helios
(17607)
The short answer is that you can't.
The long answer is that you can make numbers of arbitrary size and operate on them (but you'll have to define your own operations).
http://en.wikipedia.org/wiki/Arbitrary_precision_arithmetic
Here's a widely used library for arbitrary precision numbers:
http://gmplib.org/
Aug 14, 2009 at 10:25pm UTC
Yuan
(4)
Thanks for the links; they've been very helpful. I'll make numbers of arbitrary size. :)
Thanks again!
~Yuan
Aug 14, 2009 at 11:26pm UTC
Incubbus
(678)
isnt the following similiar?
1
2
3
4
5
struct
{
long
bla : 6
char
blubb[6] : 42 };
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs