Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Dealing with huge integers...

Name: Anonymous 2006-09-05 23:02

Hey, all.

How would I go about dealing with integers larger than, say, 340,282,366,920,938,463,463,374,607,431,768,211,455 in c++?

Any and all help would be greatly appreciated.

Name: Anonymous 2006-09-05 23:39

use LISP

Name: Anonymous 2006-09-05 23:41

Unless there are OpenGL and Direct3D implementations for LISP, I kind of can't....

Name: Anonymous 2006-09-05 23:47

>>1
Use Java BigInteger LOL

Name: Anonymous 2006-09-06 1:08

um, implement it using a class?

// true value of an ultimate_int is least_significant_value + [upper limit of long long + 1] * most_significant_value
class ultimate_int {
 public:
 long long most_significant_value
 long long least_significant_value
 private:
 operator+ [etc...]
 }

it's going to take some work, have to do ostream/istream overrides for cout/cin, etc. but it can be done

prolly already has

Name: Anonymous 2006-09-06 1:12

libgmp

Name: Anonymous 2006-09-06 2:06

>>1
What the fuck kind of program is this?

Name: Anonymous 2006-09-06 2:34

Find some bigint library

Name: Anonymous 2006-09-06 3:31

DO YOUR OWN HOMOWORK FAGGOT

Name: Anonymous 2006-09-06 5:05

CHRISTIANS

Name: Anonymous 2006-09-06 6:32

interesting question. I google for large int and the first result is probably how i do it. http://www.thescripts.com/forum/thread212731.html

Name: Anonymous 2006-09-06 10:20

BIT ARRAY

Name: Anonymous 2006-09-06 11:14

Thanks, Anonymous. Question answered.

Name: Anonymous 2006-09-06 12:14

Seriously, what the fuck are you doing with a graphics API that requires such a xbox-sized number?

Name: Anonymous 2006-09-06 16:07

>>14

I asked that because I'm primarily a graphics programmer, and I didn't want to have to learn an entirely new language just to work with large #'s.

Heheheh xbox sized number.

Name: Anonymous 2006-09-06 20:00

Uh, Direct3D and OpenGL both use floats. A better question is why you need integers to represent these large numbers.

Also, if you're having trouble with something as basic as arbitrary-length integers, there's no way you're a graphics programmer. Did you go to Devry or what?

Name: Anonymous 2006-09-06 20:32 (sage)

>>16
BWAHAHAHAHAHAAHAHHAHAhahahahaha...

AHAHAHAHAHAHAHAHAHHAHAHAHAH

I don't think this guy even knows the difference between floats and ints.

Name: Anonymous 2006-09-07 0:14

>>15
Like >>16 said, don't call yourself a graphics programmer if you don't even understand the basics, like that the pipeline uses floats and is optimized to do so, so you should use floats too.  If you are stupid enough to think using huge integers is okay, you have no understanding whatsoever of how the hardware works either.

Name: Anonymous 2006-09-07 4:09

Did any of you people think that maybe he's doing a large, complex mathematical simulator that simply had an OpenGL frontend?

Name: Anonymous 2006-09-07 4:57

>>19
Why would someone clueless do a large, complex mathematical simulator?

Arbitrary-length integer math is basic. Someone who doesn't know how to do that has no business with a complicated field like numerics.

Name: Anonymous 2006-09-07 4:58

>>20
I suppose so, yes.

Name: Anonymous 2006-09-09 0:24

>>18

Again, I didn't ask about the OpenGL and DirectX implementations because I'm working on a project that requires massive integers as graphics, I asked because I wouldn't want to learn a language with out them.

Name: Anonymous 2006-09-09 8:18

>>22
Well if you really are a "graphics programmer", why the hell would you care, since there is no place for huge integers in graphics?

Name: Anonymous 2006-09-09 11:43 (sage)

>>23
Not realtime graphics anyway.

Name: Anonymous 2006-09-09 13:47

Yes. I'm a C programmer. So? I don't see a problem. I embraced my UNIX soul long ago and I am happy together with my compiler (who is a cute layered front/backend design!). We have a fucking lot of functions in and outside of the kernel and I am pretty compact and resource conserving.

But thanks anyway asshole. Go and beat off to your stupid garbage collection shit while I #INCLUDE <stdio.h> with my preprocessor.

Name: Anonymous 2006-09-10 21:00

>>23

To be honest, I've just recently become very interested in number theory, and I thought that being able to work with retardedly large integers would benefit me. OK? Does that answer your question?

Name: Anonymous 2006-09-10 23:21

If all you want to do is crunch numbers, use OCaml.

Name: Anonymous 2010-09-21 13:15

Use strings.

Name: Anonymous 2010-09-21 13:22

Name: Anonymous 2010-09-21 14:45

>>27
If all you want to do is stroke off to your superior programming language, ignore the OP's question.

Name: Anonymous 2010-09-21 14:50

>>29
Use fucking eyes, it's a thread from 2006

Name: Anonymous 2010-09-21 16:46

Name: Anonymous 2010-09-21 17:19

gnu library for it... mp something or something

Name: opiates 2010-09-21 22:10

>>32
opiates

Name: Replying to an ancient thread 2010-09-21 23:35

One word: linked list.  Size limit is defined by available memory.  Navigating to an arbitrary digit that is not near either end will be hell regardless of what method is used since, at some point, the problem will repeat itself in the index method chosen.  With this simple procedure, however, it would theoretically be possible to allow a computer with sufficient memory to incrementally count to a number that is larger thatthe number of atoms in the visible universe with perfect precision every digit of the way, eventually.  It's a simple yet absurd concept with no application (yet).

Name: Anonymous 2010-09-22 7:10

>>36
U MENA QUANTUM COMPUTING

Name: Anonymous 2011-02-04 19:35

Name: Sgt.Kabux溼kiman둼캸 2012-05-28 20:05

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List