Euler problems 14, 135, 174

Don nospam at nospam.com
Fri Apr 9 00:13:18 PDT 2010


bearophile wrote:
> This post shows that if you want to write (even simple) numerical code that uses integral numbers, you need to use everywhere efficient multi-precision integers, or at least you need integer overflows at runtime. Otherwise you are programming in the darkness.

Although this type of code is extremely common in programming puzzles, I 
seriously doubt that it's used much anywhere else.

But anyway --- use doubles instead of ints, and turn all the floating 
point exceptions on. Will be much faster (on 32-bit compilers), and 
overflow errors get caught as soon as they occur.



More information about the Digitalmars-d mailing list