// Invocaciones incorrectas porque hace divisiones enteras en lugar de reales double f(double x) { return 2 * x - 3; } void invocarLaFuncionF() { System.out.printf( "f(0) = %.2f%n", f(0) ); System.out.printf( "f(-1) = %.2f%n", f(-1) ); System.out.printf( "f(1/2) = %.2f%n", f(1/2) ); System.out.printf( "f(-5 + 2/3) = %.2f%n", f(-5 + 2/3) ); System.out.printf( "f( f(3) ) = %.2f%n", f( f(3) ) ); System.out.printf( "f( f(1/2) * f(1) ) = %.2f%n", f( f(1/2) * f(1) ) ); } // Invocaciones corregidas con tipos de datos reales double f(double x) { return 2 * x - 3; } void invocarLaFuncionF() { System.out.printf( "f(0) = %.2f%n", f(0) ); System.out.printf( "f(-1) = %.2f%n", f(-1) ); System.out.printf( "f(1/2) = %.2f%n", f(1.0/2.0) ); System.out.printf( "f(-5 + 2/3) = %.2f%n", f(-5 + 2.0/3) ); System.out.printf( "f( f(3) ) = %.2f%n", f( f(3) ) ); System.out.printf( "f( f(1/2) * f(1) ) = %.2f%n", f( f(1/2.0) * f(1) ) ); }