Hacker News new | ask | show | jobs
by yjftsjthsd-h 702 days ago
Throw an exception, because the input is probably invalid and the output definitely will be. Of course, it follows that you need to either plan for the program to crash or catch the exception. But that's still better than just running with wrong numbers.
1 comments

> On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out? ' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.