|
|
вернуться в форумWhat in 57 test? I have a problem when comparing real numbers private static double EPS = 0.33333333333333; public static boolean eq (double a, double b) { return Math.abs (a - b) <EPS; } when checking whether a given point belongs to a parabola, I simply substitutes the x and y the function (y = x ^ 2 * a + x * b) I can not pass the test 57 Edited by author 18.09.2012 18:13 Edited by author 27.05.2014 23:45 Re: What in 57 test? the fact that a decrease in EPS say up to 1E-10 then the program does not pass the test 13 Edited by author 18.09.2012 19:14 Edited by author 27.05.2014 23:46 Re: What in 57 test? I found a suitable number: 0.000050010002, but it is only for java (passes 62nd), for C++10 does not work, a stop on the 57th. Apparently my solution is not suitable for this task. Edited by author 27.05.2014 23:46 Re: What in 57 test? Set aside the alarm! Number: 1e-8. (I found on the forum) |
|
|