Debian Codegraph @

benchmarks.larceny/src/fibfp.java

raw
1 /* FIBFP -- Computes fib(30) using floating point */
2
3 class fibfp {
4
5 static double fib (double n)
6 {
7 if (n < 2.0)
8 return n;
9 else
10 return fib (n-1.0) + fib (n-2.0);
11 }
12
13 public static void main (String args[])
14 {
15 int i;
16 double result = 0.0;
17
18 for (i=0; i<50; i++)
19 result = fib (30.0);
20
21 if (result != 832040.0)
22 System.out.println ("*** wrong result ***");
23 }
24
25 }