Debian Codegraph @

xt/author/nparts-mbf.t

raw symbols SCIP
1 # -*- mode: perl; -*-
2
3 use strictscip-perl cpan Math-BigInt 2.005003 strict/;
4 use warningsscip-perl cpan Math-BigInt 2.005003 warnings/;
5
6 use Test::Morescip-perl cpan Math-BigInt 2.005003 Test/More/ tests => 1840;
7
8 use Math::BigFloatscip-perl cpan Math-BigInt 2.005003 Math/BigFloat/;
9
10 while (<DATA>) {
11 s/#.*$//; # remove comments
12 s/\s+$//; # remove trailing whitespace
13 next unless lengthscip-perl cpan Math-BigInt 2.005003 main/length().; # skip empty lines
14
15 my ($x_str, $mant_str, $expo_str) = splitscip-perl cpan Math-BigInt 2.005003 main/split(). /:/;
16
17 notescip-perl cpan Math-BigInt 2.005003 main/note().(qq|\n\$x = Math::BigFloat -> new("$x_str");|,
18 qq| (\$m, \$e) = \$x -> nparts();\n\n|);
19
20 {
21 my $x = Math::BigFloat -> newscip-perl cpan Math-BigInt 2.005003 Math/BigFloat/new().($x_str);
22 my ($mant_got, $expo_got) = $x -> npartsscip-perl cpan Math-BigInt 2.005003 Math/BigFloat/nparts().();
23
24 isa_okscip-perl cpan Math-BigInt 2.005003 main/isa_ok().($mant_got, "Math::BigFloat");
25 isa_okscip-perl cpan Math-BigInt 2.005003 main/isa_ok().($expo_got, "Math::BigFloat");
26
27 isscip-perl cpan Math-BigInt 2.005003 main/is().($mant_got, $mant_str, "value of mantissa");
28 isscip-perl cpan Math-BigInt 2.005003 main/is().($expo_got, $expo_str, "value of exponent");
29 isscip-perl cpan Math-BigInt 2.005003 main/is().($x, $x_str, "input is unmodified");
30 }
31
32 notescip-perl cpan Math-BigInt 2.005003 main/note().(qq|\n\$x = Math::BigFloat -> new("$x_str");|,
33 qq| \$m = \$x -> nparts();\n\n|);
34
35 {
36 my $x = Math::BigFloat -> newscip-perl cpan Math-BigInt 2.005003 Math/BigFloat/new().($x_str);
37 my $mant_got = $x -> npartsscip-perl cpan Math-BigInt 2.005003 Math/BigFloat/nparts().();
38
39 isa_okscip-perl cpan Math-BigInt 2.005003 main/isa_ok().($mant_got, "Math::BigFloat");
40
41 isscip-perl cpan Math-BigInt 2.005003 main/is().($mant_got, $mant_str, "value of mantissa");
42 isscip-perl cpan Math-BigInt 2.005003 main/is().($x, $x_str, "input is unmodified");
43 }
44
45 }
46
47 __DATA__
48
49 NaN:NaN:NaN
50
51 inf:inf:inf
52 -inf:-inf:inf
53
54 0:0:0
55
56 # positive numbers
57
58 0.000000000001:1:-12
59 0.00000000001:1:-11
60 0.0000000001:1:-10
61 0.000000001:1:-9
62 0.00000001:1:-8
63 0.0000001:1:-7
64 0.000001:1:-6
65 0.00001:1:-5
66 0.0001:1:-4
67 0.001:1:-3
68 0.01:1:-2
69 0.1:1:-1
70 1:1:0
71 10:1:1
72 100:1:2
73 1000:1:3
74 10000:1:4
75 100000:1:5
76 1000000:1:6
77 10000000:1:7
78 100000000:1:8
79 1000000000:1:9
80 10000000000:1:10
81 100000000000:1:11
82 1000000000000:1:12
83
84 0.0000000000012:1.2:-12
85 0.000000000012:1.2:-11
86 0.00000000012:1.2:-10
87 0.0000000012:1.2:-9
88 0.000000012:1.2:-8
89 0.00000012:1.2:-7
90 0.0000012:1.2:-6
91 0.000012:1.2:-5
92 0.00012:1.2:-4
93 0.0012:1.2:-3
94 0.012:1.2:-2
95 0.12:1.2:-1
96 1.2:1.2:0
97 12:1.2:1
98 120:1.2:2
99 1200:1.2:3
100 12000:1.2:4
101 120000:1.2:5
102 1200000:1.2:6
103 12000000:1.2:7
104 120000000:1.2:8
105 1200000000:1.2:9
106 12000000000:1.2:10
107 120000000000:1.2:11
108 1200000000000:1.2:12
109
110 0.00000000000123:1.23:-12
111 0.0000000000123:1.23:-11
112 0.000000000123:1.23:-10
113 0.00000000123:1.23:-9
114 0.0000000123:1.23:-8
115 0.000000123:1.23:-7
116 0.00000123:1.23:-6
117 0.0000123:1.23:-5
118 0.000123:1.23:-4
119 0.00123:1.23:-3
120 0.0123:1.23:-2
121 0.123:1.23:-1
122 1.23:1.23:0
123 12.3:1.23:1
124 123:1.23:2
125 1230:1.23:3
126 12300:1.23:4
127 123000:1.23:5
128 1230000:1.23:6
129 12300000:1.23:7
130 123000000:1.23:8
131 1230000000:1.23:9
132 12300000000:1.23:10
133 123000000000:1.23:11
134 1230000000000:1.23:12
135
136 0.000000000001234:1.234:-12
137 0.00000000001234:1.234:-11
138 0.0000000001234:1.234:-10
139 0.000000001234:1.234:-9
140 0.00000001234:1.234:-8
141 0.0000001234:1.234:-7
142 0.000001234:1.234:-6
143 0.00001234:1.234:-5
144 0.0001234:1.234:-4
145 0.001234:1.234:-3
146 0.01234:1.234:-2
147 0.1234:1.234:-1
148 1.234:1.234:0
149 12.34:1.234:1
150 123.4:1.234:2
151 1234:1.234:3
152 12340:1.234:4
153 123400:1.234:5
154 1234000:1.234:6
155 12340000:1.234:7
156 123400000:1.234:8
157 1234000000:1.234:9
158 12340000000:1.234:10
159 123400000000:1.234:11
160 1234000000000:1.234:12
161
162 0.000003141592:3.141592:-6
163 0.00003141592:3.141592:-5
164 0.0003141592:3.141592:-4
165 0.003141592:3.141592:-3
166 0.03141592:3.141592:-2
167 0.3141592:3.141592:-1
168 3.141592:3.141592:0
169 31.41592:3.141592:1
170 314.1592:3.141592:2
171 3141.592:3.141592:3
172 31415.92:3.141592:4
173 314159.2:3.141592:5
174 3141592:3.141592:6
175
176 # negativ: numbers
177
178 -0.000000000001:-1:-12
179 -0.00000000001:-1:-11
180 -0.0000000001:-1:-10
181 -0.000000001:-1:-9
182 -0.00000001:-1:-8
183 -0.0000001:-1:-7
184 -0.000001:-1:-6
185 -0.00001:-1:-5
186 -0.0001:-1:-4
187 -0.001:-1:-3
188 -0.01:-1:-2
189 -0.1:-1:-1
190 -1:-1:0
191 -10:-1:1
192 -100:-1:2
193 -1000:-1:3
194 -10000:-1:4
195 -100000:-1:5
196 -1000000:-1:6
197 -10000000:-1:7
198 -100000000:-1:8
199 -1000000000:-1:9
200 -10000000000:-1:10
201 -100000000000:-1:11
202 -1000000000000:-1:12
203
204 -0.0000000000012:-1.2:-12
205 -0.000000000012:-1.2:-11
206 -0.00000000012:-1.2:-10
207 -0.0000000012:-1.2:-9
208 -0.000000012:-1.2:-8
209 -0.00000012:-1.2:-7
210 -0.0000012:-1.2:-6
211 -0.000012:-1.2:-5
212 -0.00012:-1.2:-4
213 -0.0012:-1.2:-3
214 -0.012:-1.2:-2
215 -0.12:-1.2:-1
216 -1.2:-1.2:0
217 -12:-1.2:1
218 -120:-1.2:2
219 -1200:-1.2:3
220 -12000:-1.2:4
221 -120000:-1.2:5
222 -1200000:-1.2:6
223 -12000000:-1.2:7
224 -120000000:-1.2:8
225 -1200000000:-1.2:9
226 -12000000000:-1.2:10
227 -120000000000:-1.2:11
228 -1200000000000:-1.2:12
229
230 -0.00000000000123:-1.23:-12
231 -0.0000000000123:-1.23:-11
232 -0.000000000123:-1.23:-10
233 -0.00000000123:-1.23:-9
234 -0.0000000123:-1.23:-8
235 -0.000000123:-1.23:-7
236 -0.00000123:-1.23:-6
237 -0.0000123:-1.23:-5
238 -0.000123:-1.23:-4
239 -0.00123:-1.23:-3
240 -0.0123:-1.23:-2
241 -0.123:-1.23:-1
242 -1.23:-1.23:0
243 -12.3:-1.23:1
244 -123:-1.23:2
245 -1230:-1.23:3
246 -12300:-1.23:4
247 -123000:-1.23:5
248 -1230000:-1.23:6
249 -12300000:-1.23:7
250 -123000000:-1.23:8
251 -1230000000:-1.23:9
252 -12300000000:-1.23:10
253 -123000000000:-1.23:11
254 -1230000000000:-1.23:12
255
256 -0.000000000001234:-1.234:-12
257 -0.00000000001234:-1.234:-11
258 -0.0000000001234:-1.234:-10
259 -0.000000001234:-1.234:-9
260 -0.00000001234:-1.234:-8
261 -0.0000001234:-1.234:-7
262 -0.000001234:-1.234:-6
263 -0.00001234:-1.234:-5
264 -0.0001234:-1.234:-4
265 -0.001234:-1.234:-3
266 -0.01234:-1.234:-2
267 -0.1234:-1.234:-1
268 -1.234:-1.234:0
269 -12.34:-1.234:1
270 -123.4:-1.234:2
271 -1234:-1.234:3
272 -12340:-1.234:4
273 -123400:-1.234:5
274 -1234000:-1.234:6
275 -12340000:-1.234:7
276 -123400000:-1.234:8
277 -1234000000:-1.234:9
278 -12340000000:-1.234:10
279 -123400000000:-1.234:11
280 -1234000000000:-1.234:12
281
282 -0.000003141592:-3.141592:-6
283 -0.00003141592:-3.141592:-5
284 -0.0003141592:-3.141592:-4
285 -0.003141592:-3.141592:-3
286 -0.03141592:-3.141592:-2
287 -0.3141592:-3.141592:-1
288 -3.141592:-3.141592:0
289 -31.41592:-3.141592:1
290 -314.1592:-3.141592:2
291 -3141.592:-3.141592:3
292 -31415.92:-3.141592:4
293 -314159.2:-3.141592:5
294 -3141592:-3.141592:6