From: ams AT ludd DOT luth DOT se (Martin Str|mberg) Newsgroups: comp.os.msdos.djgpp Subject: Re: Lack of overflow problem Date: 6 Jan 2000 06:49:17 GMT Organization: University of Lulea, Sweden Lines: 29 Message-ID: <851dtd$bfv$1@news.luth.se> References: NNTP-Posting-Host: queeg.ludd.luth.se X-Trace: news.luth.se 947141357 11775 130.240.16.109 (6 Jan 2000 06:49:17 GMT) X-Complaints-To: abuse AT luth DOT se NNTP-Posting-Date: 6 Jan 2000 06:49:17 GMT X-Newsreader: TIN [UNIX 1.3 950824BETA PL0] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Rob McCrea (r_mccrea AT hotmail DOT com) wrote: : My expression won't recognize the overflow... : : while ((s+1) > s) s++; : : is an infinite loop. What's up with that? : Apparently the condition is being evaluted as (1>0). : That's not right is it? I'm compiling with gpp -Wall testsize.cpp -o : testsize.exe. : : Please, can someone explain why its not acting like a computer? Don't know. But you should compile _with_ optimisations (-O2). : On the subject that led me on the above side-trip, I need a library : that will allow me to use much larger (non-float and unsigned) : integers. unsigned long long fails at 2^64 of course. I will want to : calculate up to 2^10000000 for starters, but anything that will allow : greater than 2^64 is an improvement (I'm hoping to find a type that : would only be limited by the amount of freespace on your hardrive). : Any base will work. I need multiplication (or exponential), division : (or modulo), and subtraction. If you know of one, please reply. String based calculations or similar. Right, MartinS