GNU header update.
[cacao.git] / tests / kaffe / TestFloatDouble.java
1 import java.lang.*;
2
3 class TestFloatDouble {
4         static boolean failed = false;
5
6         static void test(String s, String r) {
7                 if (!s.equals(r)) {
8                         System.out.println("result "+s+" should be "+r);
9                         failed = true;
10                 }
11         }
12
13         static void test(float v, String r) {
14                 test(Float.toString(v), r);
15         }
16
17         static void test(double v, String r) {
18                 test(Double.toString(v), r);
19         }
20
21         public static void main(String args[]) {
22                 System.out.println("Some mathmatical tests");
23                 float f1 = 500.005f;
24                 float f2 = 400.004f;
25                 test(f1 * f2, "200004");
26                 double d1 = 500.005;
27                 double d2 = 400.004;
28                 test(d1 * d2, "200004");
29                 String s = "Good";
30                 if (failed)
31                         s = "Bad";
32                 System.out.println("Results "+s);
33         }
34 }
35
36 // Skip run
37 /* Expected Output:
38 Some mathmatical tests
39 Results Good
40 */