]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bc/tests/bc/scripts/bessel.bc
Update to version 3.1.1
[FreeBSD/FreeBSD.git] / contrib / bc / tests / bc / scripts / bessel.bc
1 #! /usr/bin/bc -q
2
3 t[0] = 0
4 t[1] = 0.5
5 t[2] = 1
6 t[3] = 1.5
7 t[4] = 1.74
8 t[5] = 2
9 t[6] = 3.2345
10 t[7] = 100
11 t[8] = -0.5
12 t[9] = -1
13 t[10] = -1.5
14 t[11] = -1.74
15 t[12] = -2
16 t[13] = -3.2345
17 t[14] = -100
18
19 l = 15
20
21 a[0] = t[0]
22
23 for (i = 1; i < l; ++i) {
24         a[i * 2 - 1] = t[i]
25         a[i * 2] = -t[i]
26 }
27
28 l *= 2
29 l -= 1
30
31 for (i = 0; i < l; ++i) {
32         for (j = 0; j < l; ++j) {
33                 print "j(", a[i], ", ", a[j], ")\n"
34         }
35 }
36
37 # These are specific tests that bc could not pass at one time.
38 print "j(3, 0.75)\n"
39 print "scale = 0; j(40, 0.75)\n"
40
41 print "halt\n"
42
43 halt