Hardware Traps for Integer Overflow
Wanderer via Digitalmars-d
digitalmars-d at puremagic.com
Thu May 29 08:32:53 PDT 2014
I don't see any valid alternatives. What should ideally happen if
you increment 0xFFFF..FFFF? Should the value remain the same?
That's not much better than resetting back to zero, still a
mathematical error. Throw an exception? That would kill
performance and break lots of existing code.
If you need perfect calculations, you can always use an according
library for numbers with arbitrary precision.
More information about the Digitalmars-d
mailing list