Debian Codegraph @

Test/signum

raw
1
2
3
4 /* From [email protected] Wed Jul 14 13:46:44 1993
5 Return-Path: <[email protected]>
6 To: [email protected], [email protected]
7 Subject: bc/dc - no rest for the wicked
8 Date: Tue, 06 Jul 93 19:12:40 -0700
9 From: [email protected]
10
11 GNU bc 1.02 passes all these tests. Can you add the test to the distribution?
12 Putting it into a DejaGnu test case for GNU bc would be a great thing, too.
13 (I haven't seen the Signum paper, maybe you can dig it out.)
14
15 John Gilmore
16 Cygnus Support
17
18 ------- Forwarded Message
19
20 Date: Tue, 6 Jul 93 08:45:48 PDT
21 From: [email protected] (David Hough)
22 Message-Id: <[email protected]>
23 To: [email protected]
24 Subject: bc/dc - no rest for the wicked
25
26 Steve Sommars sent me a bc script which reproduces ALL the test cases from
27 Dittmer's paper. Neither SunOS 5.2 on SPARC nor 5.1 on x86 come out clean.
28 Anybody else who has fixed all the bugs would be justified in
29 bragging about it here. */
30
31
32 /*Ingo Dittmer, ACM Signum, April 1993, page 8-11*/
33 define g(x,y,z){
34 auto a
35 a=x%y
36 if(a!=z){
37 "
38 x=";x
39 "y=";y
40 "Should be ";z
41 "was ";a
42 }
43 }
44
45 /*Table 1*/
46 g=g(53894380494284,9980035577,2188378484)
47 g=g(47907874973121,9980035577,3704203521)
48 g=g(76850276401922,9980035577,4002459022)
49 g=g(85830854846664,9980035577,2548884464)
50 g=g(43915353970066,9980035577,3197431266)
51 g=g(35930746212825,9980035577,2618135625)
52 g=g(51900604524715,9980035577,4419524315)
53 g=g(87827018005068,9980035577,2704927468)
54 g=g(57887902441764,9980035577,3696095164)
55 g=g(96810941031110,9980035577,4595934210)
56
57 /*Table 2*/
58 g=g(86833646827370,9980035577,7337307470)
59 g=g(77850880592435,9980035577,6603091835)
60 g=g(84836601050323,9980035577,6298645823)
61 g=g(85835110016211,9980035577,6804054011)
62 g=g(94817143459192,9980035577,6805477692)
63 g=g(94818870293481,9980035577,8532311981)
64 g=g(91823235571154,9980035577,6908262754)
65 g=g(59885451951796,9980035577,5238489796)
66 g=g(80844460893239,9980035577,6172719539)
67 g=g(67869195894693,9980035577,4953971093)
68 g=g(95813990985202,9980035577,5649446002)
69
70 /*Skip Table 3, duplicate of line 1, table 1*/
71
72 /*Table 4*/
73 g=g(28420950579078013018256253301,17987947258,16619542243)
74 g=g(12015118977201790601658257234,16687885701,8697335297)
75 g=g(14349070374946789715188912007,13712994561,3605141129)
76 g=g(61984050238512905451986475027,13337935089,5296182558)
77 g=g(86189707791214681859449918641,17837971389,14435206830)
78 g=g(66747908181102582528134773954,19462997965,8615839889)
79
80 /*Table 6*/
81 g=g(4999253,9998,253)
82 g=g(8996373,9995,873)
83
84
85 /* Added by Phil Nelson..... */
86 "end of tests
87 "