amateur % pwd
/home/liang/bug/jdk114
amateur % uname -a
SunOS amateur 5.5.1 Generic_103640-08 sun4u sparc SUNW,Ultra-1
amateur % java -version
java version "1.1.4"
amateur % javac bug.java
amateur % java bug
Error: result = 1536.834181305364
must be = 2.6880135699674716E14
amateur % cat bug.java
public class bug {
private static double fun (double x)
{
double t1 = Math.sqrt(x);
return t1*Math.exp(x);
}
/***************************************************************/
private static double fun_correct (double x)
{
return Math.sqrt(x)*Math.exp(x);
}
/***************************************************************/
public static void main(String[] argv) {
double x = 31.5;
if (fun(x) != fun_correct(x)) {
System.out.println(" Error: result = "+fun(x));
System.out.println(" must be = "+fun_correct(x));
}
else
System.out.println(" TEST PASSED");
}
}
amateur %
/home/liang/bug/jdk114
amateur % uname -a
SunOS amateur 5.5.1 Generic_103640-08 sun4u sparc SUNW,Ultra-1
amateur % java -version
java version "1.1.4"
amateur % javac bug.java
amateur % java bug
Error: result = 1536.834181305364
must be = 2.6880135699674716E14
amateur % cat bug.java
public class bug {
private static double fun (double x)
{
double t1 = Math.sqrt(x);
return t1*Math.exp(x);
}
/***************************************************************/
private static double fun_correct (double x)
{
return Math.sqrt(x)*Math.exp(x);
}
/***************************************************************/
public static void main(String[] argv) {
double x = 31.5;
if (fun(x) != fun_correct(x)) {
System.out.println(" Error: result = "+fun(x));
System.out.println(" must be = "+fun_correct(x));
}
else
System.out.println(" TEST PASSED");
}
}
amateur %