public static void main(String[ ] args)
{
System.out.printf("Point A: a==%d b==%s c==%f\r\n",
a, b, c);
// Statements from top half of main.
System.out.printf("Point B: a==%d b==%s c==%f\r\n",
a, b, c);
// Statements from bottom half of main.
System.out.printf("Point C: a==%d b==%s c==%f\r\n",
a, b, c);
}
System.out.printf("Point M: a==%d b==%s c==%f\r\n",
a, b, c);
x.f( ); // Method call.
System.out.printf("Point N: a==%d b==%s c==%f\r\n",
a, b, c);
and the output indicates that there is not an error at M, but there is
an error at N, the bug is quite probably in the method f. Repeat the
same binary search procedure within the method f that you used for
the main method.
The bug cannot be in this file or method.
public static void main(String[ ] args)
{
boolean debug = true;
// statements
if (debug)
System.out.println("Point N: " + a + " " + b);
// more statements
}