You could have used Lisp, most implementations of Common Lisp guarantee that x+1 > x in all cases. So no matter how big the number, it will always work. The good news about this big number implementation is that since it is builtin, you don't have to do anything differently to use it, and it is a well-built well-supported implementation that typically is quite quick.
Remember Greenspun's tenth rule of programming:
Quote:
"Any sufficiently-complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
|