Re: [Dev-C++] Overflow detection (was No Subject)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-10-09 13:57:58
|
Are you also sick of the existing large-number libraries that exists, and that supports any number of digits up to size of available memory? To my knowledge, you can't write a portable implementation using overflow exceptions. The normal method is for example to perform all big-number arithmetic with unsigned numbers and a separately stored sign bit. Then you get: r0 = a0 + b0; overflow = r0 < a0 || r0 < b0; r1 = a1 + b1 + overflow; ... No need to work on bit level. If implemented in assembly, the overflow = r0 < a0 || r0 < b0 can be ignored, since an overflow would result in the carry bit being set in the processor flag register - all processors have support for carry bit. /Per W On Thu, 9 Oct 2003, David McKen wrote: > No I don't require it to be standard, however I would like > it to be standard. > > My current focus are speed and portability. The reason why > 64 bit won't sufice is because I would like to take a try > at the RSA factoring challenge: > > http://www.rsasecurity.com/rsalabs/challenges/factoring/faq.html > > And if you look throught you will eventually find the > challenge numbers at > > http://www.rsasecurity.com/rsalabs/challenges/factoring/numbers.html > > IF you take a look at those numbers then you will quickly > see why 64 bit is too small. Besides if I complete this > class I know at least 3-4 people who would use it because > they are sick of the 4 billlion limitation put on them. > > Thanks for your Help > > Signed > David McKen > > __________________________________ > Do you Yahoo!? > The New Yahoo! Shopping - with improved product search > http://shopping.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |