Lines Matching refs:testfmt

59 #define	testfmt(result, fmt, ...)       \
100 testfmt(" 1.000000E+00", "%13E", 1.0);
101 testfmt(" 1.000000", "%13f", 1.0);
102 testfmt(" 1", "%13G", 1.0);
103 testfmt(" 1.000000E+00", "%13LE", 1.0L);
104 testfmt(" 1.000000", "%13Lf", 1.0L);
105 testfmt(" 1", "%13LG", 1.0L);
107 testfmt("2.718282", "%.*f", -2, 2.7182818);
109 testfmt("1.234568e+06", "%e", 1234567.8);
110 testfmt("1234567.800000", "%f", 1234567.8);
111 testfmt("1.23457E+06", "%G", 1234567.8);
112 testfmt("1.234568e+06", "%Le", 1234567.8L);
113 testfmt("1234567.800000", "%Lf", 1234567.8L);
114 testfmt("1.23457E+06", "%LG", 1234567.8L);
117 testfmt("123456789.864210", "%Lf", 123456789.8642097531L);
118 testfmt("-1.23457E+08", "%LG", -123456789.8642097531L);
119 testfmt("123456789.8642097531", "%.10Lf", 123456789.8642097531L);
120 testfmt(" 3.141592653589793238e-4000", "%L27.18Le",
131 testfmt("nan", "%e", NAN);
132 testfmt("NAN", "%F", NAN);
133 testfmt("nan", "%g", NAN);
134 testfmt("NAN", "%LE", (long double)NAN);
135 testfmt(" nan", "%05e", NAN);
137 testfmt("INF", "%E", HUGE_VAL);
138 testfmt("-inf", "%f", -HUGE_VAL);
139 testfmt("+inf", "%+g", HUGE_VAL);
140 testfmt(" inf", "%4.2Le", HUGE_VALL);
141 testfmt("-inf", "%Lf", -HUGE_VALL);
142 testfmt(" inf", "%05e", HUGE_VAL);
143 testfmt(" -inf", "%05e", -HUGE_VAL);
152 testfmt("0.000000e+00", "%e", 0.0);
153 testfmt("0.000000", "%F", (double)0.0);
154 testfmt("0", "%G", 0.0);
155 testfmt(" 0", "%3.0Lg", 0.0L);
156 testfmt(" 0", "%5.0f", 0.001);
165 testfmt("1.0123e+00", "%.4e", 1.0123456789);
166 testfmt("1.0123", "%.4f", 1.0123456789);
167 testfmt("1.012", "%.4g", 1.0123456789);
168 testfmt("1.2346e-02", "%.4e", 0.0123456789);
169 testfmt("0.0123", "%.4f", 0.0123456789);
170 testfmt("0.01235", "%.4g", 0.0123456789);
179 testfmt("12345678.0625", "%'.04f", 12345678.0625);
180 testfmt("0012345678.0625", "%'015.4F", 12345678.0625);
183 testfmt("1,23,45,678.0625", "%'.4f", 12345678.0625);
184 testfmt("01,23,45,678.0625", "%'017.4F", 12345678.0625);
185 testfmt(" 9,000", "%'6.0f", 9000.0);
186 testfmt("9,000.0", "%'.1f", 9000.0);
189 testfmt("3,1415", "%g", 3.1415);
193 testfmt("1.234,00", "%'.2f", 1234.00);
194 testfmt("123.456,789", "%'.3f", 123456.789);
197 testfmt("12345678.062500", "%'f", 12345678.0625);
198 testfmt("9000.000000", "%'f", 9000.0);
207 testfmt("+2.500000e-01", "%+e", 0.25);
208 testfmt("+0.000000", "%+F", 0.0);
209 testfmt("-1", "%+g", -1.0);
211 testfmt("-1.000000e+00", "% e", -1.0);
212 testfmt("+1.000000", "% +f", 1.0);
213 testfmt(" 1", "% g", 1.0);
214 testfmt(" 0", "% g", 0.0);
223 testfmt("1.250e+00", "%#.3e", 1.25);
224 testfmt("123.000000", "%#f", 123.0);
225 testfmt(" 12345.", "%#7.5g", 12345.0);
226 testfmt(" 1.00000", "%#8g", 1.0);
227 testfmt("0.0", "%#.2g", 0.0);
236 testfmt("03.2E+00", "%08.1E", 3.25);
237 testfmt("003.25", "%06.2F", 3.25);
238 testfmt("0003.25", "%07.4G", 3.25);
240 testfmt("3.14159e-05", "%g", 3.14159e-5);
241 testfmt("0.000314159", "%g", 3.14159e-4);
242 testfmt("3.14159e+06", "%g", 3.14159e6);
243 testfmt("314159", "%g", 3.14159e5);
244 testfmt("314159.", "%#g", 3.14159e5);
246 testfmt(" 9.000000e+03", "%13e", 9000.0);
247 testfmt(" 9000.000000", "%12f", 9000.0);
248 testfmt(" 9000", "%5g", 9000.0);
249 testfmt(" 900000.", "%#8g", 900000.0);
250 testfmt(" 9e+06", "%6g", 9000000.0);
251 testfmt(" 9.000000e-04", "%13e", 0.0009);
252 testfmt(" 0.000900", "%9f", 0.0009);
253 testfmt(" 0.0009", "%7g", 0.0009);
254 testfmt(" 9e-05", "%6g", 0.00009);
255 testfmt(" 9.00000e-05", "%#12g", 0.00009);
256 testfmt(" 9.e-05", "%#7.1g", 0.00009);
258 testfmt(" 0.0", "%4.1f", 0.0);
259 testfmt("90.0", "%4.1f", 90.0);
260 testfmt(" 100", "%4.0f", 100.0);
261 testfmt("9.0e+01", "%4.1e", 90.0);
262 testfmt("1e+02", "%4.0e", 100.0);
272 testfmt("4.437", "%.3f", 4.4375);
273 testfmt("-4.438", "%.3f", -4.4375);
274 testfmt("4.437", "%.3Lf", 4.4375L);
275 testfmt("-4.438", "%.3Lf", -4.4375L);
278 testfmt("4.438", "%.3f", 4.4375);
279 testfmt("-4.437", "%.3f", -4.4375);
280 testfmt("4.438", "%.3Lf", 4.4375L);
281 testfmt("-4.437", "%.3Lf", -4.4375L);
284 testfmt("4.437", "%.3f", 4.4375);
285 testfmt("-4.437", "%.3f", -4.4375);
286 testfmt("4.437", "%.3Lf", 4.4375L);
287 testfmt("-4.437", "%.3Lf", -4.4375L);
290 testfmt("4.438", "%.3f", 4.4375);
291 testfmt("-4.438", "%.3f", -4.4375);
292 testfmt("4.438", "%.3Lf", 4.4375L);
293 testfmt("-4.438", "%.3Lf", -4.4375L);
307 testfmt("0x0p+0", "%a", 0x0.0p0);
308 testfmt("0X0.P+0", "%#LA", 0x0.0p0L);
309 testfmt("inf", "%La", (long double)INFINITY);
310 testfmt("+INF", "%+A", INFINITY);
311 testfmt("nan", "%La", (long double)NAN);
312 testfmt("NAN", "%A", NAN);
314 testfmt(" 0x1.23p+0", "%10a", 0x1.23p0);
315 testfmt(" 0x1.23p-500", "%12a", 0x1.23p-500);
316 testfmt(" 0x1.2p+40", "%10.1a", 0x1.23p40);
317 testfmt(" 0X1.230000000000000000000000P-4", "%32.24A", 0x1.23p-4);
318 testfmt("0x1p-1074", "%a", 0x1p-1074);
319 testfmt("0x1.2345p-1024", "%a", 0x1.2345p-1024);
322 testfmt("0x1.921fb54442d18468p+1", "%La", 0x3.243f6a8885a308dp0L);
323 testfmt("0x1p-16445", "%La", 0x1p-16445L);
324 testfmt("0x1.30ecap-16381", "%La", 0x9.8765p-16384L);
326 testfmt("0x1.921fb54442d18469898cc51701b8p+1", "%La",
328 testfmt("0x1p-16494", "%La", 0x1p-16494L);
329 testfmt("0x1.2345p-16384", "%La", 0x1.2345p-16384L);
331 testfmt("0x1.921fb54442d18p+1", "%La", 0x3.243f6a8885a31p0L);
332 testfmt("0x1p-1074", "%La", 0x1p-1074L);
333 testfmt("0x1.30ecap-1021", "%La", 0x9.8765p-1024L);
344 testfmt("0X1.23456789ABCP+0", "%.11A", 0x1.23456789abcdep0);
345 testfmt("-0x1.23456p+0", "%.5a", -0x1.23456789abcdep0);
346 testfmt("0x1.23456p+0", "%.5a", 0x1.23456789abcdep0);
347 testfmt("0x1.234567p+0", "%.6a", 0x1.23456789abcdep0);
348 testfmt("-0x1.234566p+0", "%.6a", -0x1.23456689abcdep0);
351 testfmt("0X1.23456789ABCP+0", "%.11A", 0x1.23456789abcdep0);
352 testfmt("-0x1.23457p+0", "%.5a", -0x1.23456789abcdep0);
353 testfmt("0x1.23456p+0", "%.5a", 0x1.23456789abcdep0);
354 testfmt("0x1.234567p+0", "%.6a", 0x1.23456789abcdep0);
355 testfmt("-0x1.234567p+0", "%.6a", -0x1.23456689abcdep0);
358 testfmt("0X1.23456789ABDP+0", "%.11A", 0x1.23456789abcdep0);
359 testfmt("-0x1.23456p+0", "%.5a", -0x1.23456789abcdep0);
360 testfmt("0x1.23457p+0", "%.5a", 0x1.23456789abcdep0);
361 testfmt("0x1.234568p+0", "%.6a", 0x1.23456789abcdep0);
362 testfmt("-0x1.234566p+0", "%.6a", -0x1.23456689abcdep0);
365 testfmt("0x1.23456789abcdep+4", "%a", 0x1.23456789abcdep4);
366 testfmt("0X1.23456789ABDP+0", "%.11A", 0x1.23456789abcdep0);
367 testfmt("-0x1.23456p+0", "%.5a", -0x1.23456789abcdep0);
368 testfmt("0x1.23456p+0", "%.5a", 0x1.23456789abcdep0);
369 testfmt("0x1.234568p+0", "%.6a", 0x1.23456789abcdep0);
370 testfmt("-0x1.234567p+0", "%.6a", -0x1.23456689abcdep0);
371 testfmt("0x1.00p-1029", "%.2a", 0x1.fffp-1030);
372 testfmt("0x1.00p-1026", "%.2a", 0xf.fffp-1030);
373 testfmt("0x1.83p+0", "%.2a", 1.51);