[Shootout-list] Re: sumcol - when the correct answer is wrong :-)
Brent Fulgham
bfulg@pacbell.net
Tue, 21 Sep 2004 10:34:27 -0700 (PDT)
--- Brian Hurt <bhurt@spnz.org> wrote:
> > Maybe we should have a new test
> > - where success was either providing the right
> > answer, or failing at runtime (see what
> > performance is like with runtime checks enabled);
> > and failure was silently ignoring the error ;-)
>
> Was that an error? There are good reasons for a
> language to define that behavior. Unless the test
> is "how well does the language handle big
> ints?"
I disagree. I don't think it is reasonable behavior
to allow integer overlow, unless the developer
explicitely codes to allow this behavior. Silently
handling a catastrophic condition like this is why
cancer patients receive overdoses of radiation,
satellites crash into planets, and corporate loan
balances turn into "credit" values.
> Unless you're testing the performance of big ints,
> I'd recommend no test require an integer larger
> than +/- 2^30 to be represented.
Most tests are confined to 32-bit values. However,
because modern systems are so fast we can't capture
data at a fine enough resolution on certain tests
without resorting to very large values.
-Brent