Rounding solutions to an integer

Back to General discussions forum

Tor Lobo     2014-09-26 16:06:01
User avatar

In general, I think it is a mistake to have us round off our errors to the nearest int, and then consider it wrong if the answer is off by 1.

Example: a = 1.49999999999999999, b = 1.5000000000000000

When you round them off, one answer can be correct while the other is wrong.

A better method is to decide how close you want the answers to be, then specify that the answers be submitted to a particular precision: "to n decimal places". Then grade the answer by doing the math to see how different it is from the desired solution. I realize this is more difficult for you - you can't just directly compare the text of the submissions, but should be possible, I would think.

Rodion (admin)     2014-09-26 17:44:57
User avatar

> I realize this is more difficult for you - you can't just directly compare the text of the submissions, but should be possible, I would think.

You are right, at the beginning functionality of the site was worse than now and so problems added at different time may rely on different rounding of results. Currently it is usually possible to compare float answers with given precision and do some more tricks.

So if you want the checker of some specific problem to be revised and probably updated, please tell its title or number and I'll try to improve it!

Please login and solve 5 problems to be able to post at forum