ReactOS  0.4.14-dev-614-gbfd8a84
ieee.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPL - See COPYING in the top level directory
4  * PURPOSE: Tests for IEEE floatting-point functions
5  * PROGRAMMER: Pierre Schweitzer (pierre@reactos.org)
6  * REFERENCES: http://msdn.microsoft.com/en-US/library/h7zkk1bz%28v=VS.80%29.aspx
7  */
8 
9 #include <apitest.h>
10 
11 #include <float.h>
12 #include <math.h>
13 
14 typedef union
15 {
16  double d;
17  long long l;
18 } ieee_double;
19 
20 void test_finite(void)
21 {
22  ieee_double tested;
23 
24  tested.l = 0xFFFFFFFFFFFFFFFFLL;
25  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
26  tested.l = 0xFFF8000000000001LL;
27  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
28  tested.l = 0xFFF8000000000000LL;
29  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
30  tested.l = 0xFFF7FFFFFFFFFFFFLL;
31  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
32  tested.l = 0xFFF0000000000001LL;
33  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
34  tested.l = 0xFFF0000000000000LL;
35  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
36  tested.l = 0xFFEFFFFFFFFFFFFFLL;
37  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
38  tested.l = 0x8010000000000000LL;
39  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
40  tested.l = 0x800FFFFFFFFFFFFFLL;
41  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
42  tested.l = 0x8000000000000001LL;
43  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
44  tested.l = 0x8000000000000000LL;
45  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
46  tested.l = 0x0000000000000000LL;
47  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
48  tested.l = 0x0000000000000001LL;
49  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
50  tested.l = 0x000FFFFFFFFFFFFFLL;
51  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
52  tested.l = 0x0010000000000000LL;
53  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
54  tested.l = 0x7FEFFFFFFFFFFFFFLL;
55  ok(_finite(tested.d) == TRUE, "_finite = FALSE\n");
56  tested.l = 0x7FF0000000000000LL;
57  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
58  tested.l = 0x7FF0000000000001LL;
59  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
60  tested.l = 0x7FF7FFFFFFFFFFFFLL;
61  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
62  tested.l = 0x7FF8000000000000LL;
63  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
64  tested.l = 0x7FFFFFFFFFFFFFFFLL;
65  ok(_finite(tested.d) == FALSE, "_finite = TRUE\n");
66 
67  /* MSDN example */
68  ok(_finite(2.387000) == TRUE, "_finite = FALSE\n");
69 }
70 
71 void test_fpclass(void)
72 {
73  int class;
74  ieee_double tested;
75 
76  tested.l = 0xFFFFFFFFFFFFFFFFLL;
77  class = _fpclass(tested.d);
78  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
79  tested.l = 0xFFF8000000000001LL;
80  class = _fpclass(tested.d);
81  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
82  tested.l = 0xFFF8000000000000LL;
83  class = _fpclass(tested.d);
84  /* Normally it has no class, but w2k3 defines it
85  * like that
86  */
87  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
88  tested.l = 0xFFF7FFFFFFFFFFFFLL;
89  class = _fpclass(tested.d);
90  /* According to IEEE, it should be Signaling NaN, but
91  * on w2k3, it's Quiet NAN
92  * ok(class == _FPCLASS_SNAN, "class = %d\n", class);
93  */
94  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
95  tested.l = 0xFFF0000000000001LL;
96  class = _fpclass(tested.d);
97  /* According to IEEE, it should be Signaling NaN, but
98  * on w2k3, it's Quiet NAN
99  * ok(class == _FPCLASS_SNAN, "class = %d\n", class);
100  */
101  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
102  tested.l = 0xFFF0000000000000LL;
103  class = _fpclass(tested.d);
104  ok(class == _FPCLASS_NINF, "class = %d\n", class);
105  tested.l = 0xFFEFFFFFFFFFFFFFLL;
106  class = _fpclass(tested.d);
107  ok(class == _FPCLASS_NN, "class = %d\n", class);
108  tested.l = 0x8010000000000000LL;
109  class = _fpclass(tested.d);
110  ok(class == _FPCLASS_NN, "class = %d\n", class);
111  tested.l = 0x800FFFFFFFFFFFFFLL;
112  class = _fpclass(tested.d);
113  ok(class == _FPCLASS_ND, "class = %d\n", class);
114  tested.l = 0x8000000000000001LL;
115  class = _fpclass(tested.d);
116  ok(class == _FPCLASS_ND, "class = %d\n", class);
117  tested.l = 0x8000000000000000LL;
118  class = _fpclass(tested.d);
119  ok(class == _FPCLASS_NZ, "class = %d\n", class);
120  tested.l = 0x0000000000000000LL;
121  class = _fpclass(tested.d);
122  ok(class == _FPCLASS_PZ, "class = %d\n", class);
123  tested.l = 0x0000000000000001LL;
124  class = _fpclass(tested.d);
125  ok(class == _FPCLASS_PD, "class = %d\n", class);
126  tested.l = 0x000FFFFFFFFFFFFFLL;
127  class = _fpclass(tested.d);
128  ok(class == _FPCLASS_PD, "class = %d\n", class);
129  tested.l = 0x0010000000000000LL;
130  class = _fpclass(tested.d);
131  ok(class == _FPCLASS_PN, "class = %d\n", class);
132  tested.l = 0x7FEFFFFFFFFFFFFFLL;
133  class = _fpclass(tested.d);
134  ok(class == _FPCLASS_PN, "class = %d\n", class);
135  tested.l = 0x7FF0000000000000LL;
136  class = _fpclass(tested.d);
137  ok(class == _FPCLASS_PINF, "class = %d\n", class);
138  tested.l = 0x7FF0000000000001LL;
139  class = _fpclass(tested.d);
140  /* According to IEEE, it should be Signaling NaN, but
141  * on w2k3, it's Quiet NAN
142  * ok(class == _FPCLASS_SNAN, "class = %d\n", class);
143  */
144  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
145  tested.l = 0x7FF7FFFFFFFFFFFFLL;
146  class = _fpclass(tested.d);
147  /* According to IEEE, it should be Signaling NaN, but
148  * on w2k3, it's Quiet NAN
149  * ok(class == _FPCLASS_SNAN, "class = %d\n", class);
150  */
151  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
152  tested.l = 0x7FF8000000000000LL;
153  class = _fpclass(tested.d);
154  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
155  tested.l = 0x7FFFFFFFFFFFFFFFLL;
156  class = _fpclass(tested.d);
157  ok(class == _FPCLASS_QNAN, "class = %d\n", class);
158 
159  /* MSDN example */
160  class = _fpclass(2.387000);
161  ok(class == _FPCLASS_PN, "class = %d\n", class);
162 }
163 
164 void test_isnan(void)
165 {
166  ieee_double tested;
167 
168  tested.l = 0xFFFFFFFFFFFFFFFFLL;
169  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
170  tested.l = 0xFFF8000000000001LL;
171  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
172  tested.l = 0xFFF8000000000000LL;
173  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
174  tested.l = 0xFFF7FFFFFFFFFFFFLL;
175  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
176  tested.l = 0xFFF0000000000001LL;
177  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
178  tested.l = 0xFFF0000000000000LL;
179  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
180  tested.l = 0xFFEFFFFFFFFFFFFFLL;
181  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
182  tested.l = 0x8010000000000000LL;
183  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
184  tested.l = 0x800FFFFFFFFFFFFFLL;
185  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
186  tested.l = 0x8000000000000001LL;
187  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
188  tested.l = 0x8000000000000000LL;
189  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
190  tested.l = 0x0000000000000000LL;
191  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
192  tested.l = 0x0000000000000001LL;
193  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
194  tested.l = 0x000FFFFFFFFFFFFFLL;
195  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
196  tested.l = 0x0010000000000000LL;
197  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
198  tested.l = 0x7FEFFFFFFFFFFFFFLL;
199  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
200  tested.l = 0x7FF0000000000000LL;
201  ok(_isnan(tested.d) == FALSE, "_isnan = TRUE\n");
202  tested.l = 0x7FF0000000000001LL;
203  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
204  tested.l = 0x7FF7FFFFFFFFFFFFLL;
205  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
206  tested.l = 0x7FF8000000000000LL;
207  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
208  tested.l = 0x7FFFFFFFFFFFFFFFLL;
209  ok(_isnan(tested.d) == TRUE, "_isnan = FALSE\n");
210 
211  /* MSDN example */
212  ok(_isnan(2.387000) == FALSE, "_isnan = TRUE\n");
213 }
214 
215 void test_j0(void)
216 {
217  ieee_double tested;
220 
221  expected.l = 0;
222 
223  errno = 0xDEADBEEF;
224  tested.l = 0xFFFFFFFFFFFFFFFFLL;
225  expected.l = 0xFFFFFFFFFFFFFFFFLL;
226  result.d = _j0(tested.d);
227  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
228  ok(errno == EDOM, "errno: %d\n", errno);
229  errno = 0xDEADBEEF;
230  tested.l = 0xFFF8000000000001LL;
231  expected.l = 0xFFF8000000000001LL;
232  result.d = _j0(tested.d);
233  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
234  ok(errno == EDOM, "errno: %d\n", errno);
235  errno = 0xDEADBEEF;
236  tested.l = 0xFFF8000000000000LL;
237  expected.l = 0xFFF8000000000000LL;
238  result.d = _j0(tested.d);
239  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
240  ok(errno == EDOM, "errno: %d\n", errno);
241  errno = 0xDEADBEEF;
242  tested.l = 0xFFF7FFFFFFFFFFFFLL;
243  expected.l = 0xFFFFFFFFFFFFFFFFLL;
244  result.d = _j0(tested.d);
245  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
246  ok(errno == EDOM, "errno: %d\n", errno);
247  errno = 0xDEADBEEF;
248  tested.l = 0xFFF0000000000001LL;
249  expected.l = 0xFFF8000000000001LL;
250  result.d = _j0(tested.d);
251  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
252  ok(errno == EDOM, "errno: %d\n", errno);
253  errno = 0xDEADBEEF;
254  tested.l = 0xFFF0000000000000LL;
255  expected.l = 0xFFF8000000000000LL;
256  result.d = _j0(tested.d);
257  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
258  ok(errno == EDOM, "errno: %d\n", errno);
259  errno = 0xDEADBEEF;
260  tested.l = 0xFFEFFFFFFFFFFFFFLL;
261  expected.l = 0x1FE7206E1D6FDCFALL;
262  result.d = _j0(tested.d);
263  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
264  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
265  errno = 0xDEADBEEF;
266  tested.l = 0x8010000000000000LL;
267  expected.l = 0x3FF0000000000000LL;
268  result.d = _j0(tested.d);
269  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
270  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
271  errno = 0xDEADBEEF;
272  tested.l = 0x800FFFFFFFFFFFFFLL;
273  expected.l = 0x3FF0000000000000LL;
274  result.d = _j0(tested.d);
275  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
276  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
277  errno = 0xDEADBEEF;
278  tested.l = 0x8000000000000001LL;
279  expected.l = 0x3FF0000000000000LL;
280  result.d = _j0(tested.d);
281  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
282  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
283  errno = 0xDEADBEEF;
284  tested.l = 0x8000000000000000LL;
285  expected.l = 0x3FF0000000000000LL;
286  result.d = _j0(tested.d);
287  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
288  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
289  errno = 0xDEADBEEF;
290  tested.l = 0x0000000000000000LL;
291  expected.l = 0x3FF0000000000000LL;
292  result.d = _j0(tested.d);
293  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
294  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
295  errno = 0xDEADBEEF;
296  tested.l = 0x0000000000000001LL;
297  expected.l = 0x3FF0000000000000LL;
298  result.d = _j0(tested.d);
299  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
300  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
301  errno = 0xDEADBEEF;
302  tested.l = 0x000FFFFFFFFFFFFFLL;
303  expected.l = 0x3FF0000000000000LL;
304  result.d = _j0(tested.d);
305  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
306  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
307  errno = 0xDEADBEEF;
308  tested.l = 0x0010000000000000LL;
309  expected.l = 0x3FF0000000000000LL;
310  result.d = _j0(tested.d);
311  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
312  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
313  errno = 0xDEADBEEF;
314  tested.l = 0x7FEFFFFFFFFFFFFFLL;
315  expected.l = 0x1FE7206E1D6FDCFALL;
316  result.d = _j0(tested.d);
317  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
318  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
319  errno = 0xDEADBEEF;
320  tested.l = 0x7FF0000000000000LL;
321  expected.l = 0xFFF8000000000000LL;
322  result.d = _j0(tested.d);
323  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
324  ok(errno == EDOM, "errno: %d\n", errno);
325  errno = 0xDEADBEEF;
326  tested.l = 0x7FF0000000000001LL;
327  expected.l = 0x7FF8000000000001LL;
328  result.d = _j0(tested.d);
329  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
330  ok(errno == EDOM, "errno: %d\n", errno);
331  errno = 0xDEADBEEF;
332  tested.l = 0x7FF7FFFFFFFFFFFFLL;
333  expected.l = 0x7FFFFFFFFFFFFFFFLL;
334  result.d = _j0(tested.d);
335  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
336  ok(errno == EDOM, "errno: %d\n", errno);
337  errno = 0xDEADBEEF;
338  tested.l = 0x7FF8000000000000LL;
339  expected.l = 0x7FF8000000000000LL;
340  result.d = _j0(tested.d);
341  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
342  ok(errno == EDOM, "errno: %d\n", errno);
343  errno = 0xDEADBEEF;
344  tested.l = 0x7FFFFFFFFFFFFFFFLL;
345  expected.l = 0x7FFFFFFFFFFFFFFFLL;
346  result.d = _j0(tested.d);
347  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
348  ok(errno == EDOM, "errno: %d\n", errno);
349 
350  /* MSDN example */
351  errno = 0xDEADBEEF;
352  tested.d = 2.387000;
353  expected.l = 0x3F83059F9F6F30CALL;
354  result.d = _j0(tested.d);
355  ok(result.l == expected.l, "_j0 returned: %I64x\n", result.l);
356  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
357 }
358 
359 void test_j1(void)
360 {
361  ieee_double tested;
364 
365  expected.l = 0;
366 
367  errno = 0xDEADBEEF;
368  tested.l = 0xFFFFFFFFFFFFFFFFLL;
369  expected.l = 0xFFFFFFFFFFFFFFFFLL;
370  result.d = _j1(tested.d);
371  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
372  ok(errno == EDOM, "errno: %d\n", errno);
373  errno = 0xDEADBEEF;
374  tested.l = 0xFFF8000000000001LL;
375  expected.l = 0xFFF8000000000001LL;
376  result.d = _j1(tested.d);
377  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
378  ok(errno == EDOM, "errno: %d\n", errno);
379  errno = 0xDEADBEEF;
380  tested.l = 0xFFF8000000000000LL;
381  expected.l = 0xFFF8000000000000LL;
382  result.d = _j1(tested.d);
383  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
384  ok(errno == EDOM, "errno: %d\n", errno);
385  errno = 0xDEADBEEF;
386  tested.l = 0xFFF7FFFFFFFFFFFFLL;
387  expected.l = 0xFFFFFFFFFFFFFFFFLL;
388  result.d = _j1(tested.d);
389  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
390  ok(errno == EDOM, "errno: %d\n", errno);
391  errno = 0xDEADBEEF;
392  tested.l = 0xFFF0000000000001LL;
393  expected.l = 0xFFF8000000000001LL;
394  result.d = _j1(tested.d);
395  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
396  ok(errno == EDOM, "errno: %d\n", errno);
397  errno = 0xDEADBEEF;
398  tested.l = 0xFFF0000000000000LL;
399  expected.l = 0xFFF8000000000000LL;
400  result.d = _j1(tested.d);
401  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
402  ok(errno == EDOM, "errno: %d\n", errno);
403  errno = 0xDEADBEEF;
404  tested.l = 0xFFEFFFFFFFFFFFFFLL;
405  expected.l = 0x9FE7206E1D6FDCFALL;
406  result.d = _j1(tested.d);
407  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
408  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
409  errno = 0xDEADBEEF;
410  tested.l = 0x8010000000000000LL;
411  expected.l = 0x8008000000000000LL;
412  result.d = _j1(tested.d);
413  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
414  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
415  errno = 0xDEADBEEF;
416  tested.l = 0x800FFFFFFFFFFFFFLL;
417  expected.l = 0x8008000000000000LL;
418  result.d = _j1(tested.d);
419  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
420  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
421  errno = 0xDEADBEEF;
422  tested.l = 0x8000000000000001LL;
423  expected.l = 0x8000000000000000LL;
424  result.d = _j1(tested.d);
425  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
426  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
427  errno = 0xDEADBEEF;
428  tested.l = 0x8000000000000000LL;
429  expected.l = 0x8000000000000000LL;
430  result.d = _j1(tested.d);
431  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
432  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
433  errno = 0xDEADBEEF;
434  tested.l = 0x0000000000000000LL;
435  expected.l = 0x0000000000000000LL;
436  result.d = _j1(tested.d);
437  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
438  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
439  errno = 0xDEADBEEF;
440  tested.l = 0x0000000000000001LL;
441  expected.l = 0x0000000000000000LL;
442  result.d = _j1(tested.d);
443  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
444  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
445  errno = 0xDEADBEEF;
446  tested.l = 0x000FFFFFFFFFFFFFLL;
447  expected.l = 0x0008000000000000LL;
448  result.d = _j1(tested.d);
449  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
450  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
451  errno = 0xDEADBEEF;
452  tested.l = 0x0010000000000000LL;
453  expected.l = 0x0008000000000000LL;
454  result.d = _j1(tested.d);
455  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
456  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
457  errno = 0xDEADBEEF;
458  tested.l = 0x7FEFFFFFFFFFFFFFLL;
459  expected.l = 0x1FE7206E1D6FDCFALL;
460  result.d = _j1(tested.d);
461  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
462  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
463  errno = 0xDEADBEEF;
464  tested.l = 0x7FF0000000000000LL;
465  expected.l = 0xFFF8000000000000LL;
466  result.d = _j1(tested.d);
467  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
468  ok(errno == EDOM, "errno: %d\n", errno);
469  errno = 0xDEADBEEF;
470  tested.l = 0x7FF0000000000001LL;
471  expected.l = 0x7FF8000000000001LL;
472  result.d = _j1(tested.d);
473  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
474  ok(errno == EDOM, "errno: %d\n", errno);
475  errno = 0xDEADBEEF;
476  tested.l = 0x7FF7FFFFFFFFFFFFLL;
477  expected.l = 0x7FFFFFFFFFFFFFFFLL;
478  result.d = _j1(tested.d);
479  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
480  ok(errno == EDOM, "errno: %d\n", errno);
481  errno = 0xDEADBEEF;
482  tested.l = 0x7FF8000000000000LL;
483  expected.l = 0x7FF8000000000000LL;
484  result.d = _j1(tested.d);
485  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
486  ok(errno == EDOM, "errno: %d\n", errno);
487  errno = 0xDEADBEEF;
488  tested.l = 0x7FFFFFFFFFFFFFFFLL;
489  expected.l = 0x7FFFFFFFFFFFFFFFLL;
490  result.d = _j1(tested.d);
491  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
492  ok(errno == EDOM, "errno: %d\n", errno);
493 
494  /* MSDN example */
495  errno = 0xDEADBEEF;
496  tested.d = 2.387000;
497  expected.l = 0x3FE0BBEFC62ABAB1LL;
498  result.d = _j1(tested.d);
499  ok(result.l == expected.l, "_j1 returned: %I64x\n", result.l);
500  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
501 }
502 
503 void test_scalb(void)
504 {
505  ieee_double tested;
508 
509  expected.l = 0;
510 
511  errno = 0xDEADBEEF;
512  tested.l = 0xFFFFFFFFFFFFFFFFLL;
513  expected.l = 0xFFFFFFFFFFFFFFFFLL;
514  result.d = _scalb(tested.d, 3);
515  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
516  ok(errno == EDOM, "errno: %d\n", errno);
517  errno = 0xDEADBEEF;
518  tested.l = 0xFFF8000000000001LL;
519  expected.l = 0xFFF8000000000001LL;
520  result.d = _scalb(tested.d, 3);
521  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
522  ok(errno == EDOM, "errno: %d\n", errno);
523  errno = 0xDEADBEEF;
524  tested.l = 0xFFF8000000000000LL;
525  expected.l = 0xFFF8000000000000LL;
526  result.d = _scalb(tested.d, 3);
527  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
528  ok(errno == EDOM, "errno: %d\n", errno);
529  errno = 0xDEADBEEF;
530  tested.l = 0xFFF7FFFFFFFFFFFFLL;
531  expected.l = 0xFFFFFFFFFFFFFFFFLL;
532  result.d = _scalb(tested.d, 3);
533  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
534  ok(errno == EDOM, "errno: %d\n", errno);
535  errno = 0xDEADBEEF;
536  tested.l = 0xFFF0000000000001LL;
537  expected.l = 0xFFF8000000000001LL;
538  result.d = _scalb(tested.d, 3);
539  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
540  ok(errno == EDOM, "errno: %d\n", errno);
541  errno = 0xDEADBEEF;
542  tested.l = 0xFFF0000000000000LL;
543  expected.l = 0xFFF0000000000000LL;
544  result.d = _scalb(tested.d, 3);
545  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
546  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
547  errno = 0xDEADBEEF;
548  tested.l = 0xFFEFFFFFFFFFFFFFLL;
549  expected.l = 0xFFF0000000000000LL;
550  result.d = _scalb(tested.d, 3);
551  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
552  ok(errno == ERANGE, "errno: %d\n", errno);
553  errno = 0xDEADBEEF;
554  tested.l = 0x8010000000000000LL;
555  expected.l = 0x8040000000000000LL;
556  result.d = _scalb(tested.d, 3);
557  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
558  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
559  errno = 0xDEADBEEF;
560  tested.l = 0x800FFFFFFFFFFFFFLL;
561  expected.l = 0x803FFFFFFFFFFFFELL;
562  result.d = _scalb(tested.d, 3);
563  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
564  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
565  errno = 0xDEADBEEF;
566  tested.l = 0x8000000000000001LL;
567  expected.l = 0x8000000000000008LL;
568  result.d = _scalb(tested.d, 3);
569  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
570  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
571  errno = 0xDEADBEEF;
572  tested.l = 0x8000000000000000LL;
573  expected.l = 0x8000000000000000LL;
574  result.d = _scalb(tested.d, 3);
575  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
576  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
577  errno = 0xDEADBEEF;
578  tested.l = 0x0000000000000000LL;
579  expected.l = 0x0000000000000000LL;
580  result.d = _scalb(tested.d, 3);
581  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
582  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
583  errno = 0xDEADBEEF;
584  tested.l = 0x0000000000000001LL;
585  expected.l = 0x0000000000000008LL;
586  result.d = _scalb(tested.d, 3);
587  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
588  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
589  errno = 0xDEADBEEF;
590  tested.l = 0x000FFFFFFFFFFFFFLL;
591  expected.l = 0x003FFFFFFFFFFFFELL;
592  result.d = _scalb(tested.d, 3);
593  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
594  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
595  errno = 0xDEADBEEF;
596  tested.l = 0x0010000000000000LL;
597  expected.l = 0x0040000000000000LL;
598  result.d = _scalb(tested.d, 3);
599  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
600  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
601  errno = 0xDEADBEEF;
602  tested.l = 0x7FEFFFFFFFFFFFFFLL;
603  expected.l = 0x7FF0000000000000LL;
604  result.d = _scalb(tested.d, 3);
605  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
606  ok(errno == ERANGE, "errno: %d\n", errno);
607  errno = 0xDEADBEEF;
608  tested.l = 0x7FF0000000000000LL;
609  expected.l = 0x7FF0000000000000LL;
610  result.d = _scalb(tested.d, 3);
611  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
612  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
613  errno = 0xDEADBEEF;
614  tested.l = 0x7FF0000000000001LL;
615  expected.l = 0x7FF8000000000001LL;
616  result.d = _scalb(tested.d, 3);
617  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
618  ok(errno == EDOM, "errno: %d\n", errno);
619  errno = 0xDEADBEEF;
620  tested.l = 0x7FF7FFFFFFFFFFFFLL;
621  expected.l = 0x7FFFFFFFFFFFFFFFLL;
622  result.d = _scalb(tested.d, 3);
623  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
624  ok(errno == EDOM, "errno: %d\n", errno);
625  errno = 0xDEADBEEF;
626  tested.l = 0x7FF8000000000000LL;
627  expected.l = 0x7FF8000000000000LL;
628  result.d = _scalb(tested.d, 3);
629  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
630  ok(errno == EDOM, "errno: %d\n", errno);
631  errno = 0xDEADBEEF;
632  tested.l = 0x7FFFFFFFFFFFFFFFLL;
633  expected.l = 0x7FFFFFFFFFFFFFFFLL;
634  result.d = _scalb(tested.d, 3);
635  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
636  ok(errno == EDOM, "errno: %d\n", errno);
637 
638  /* MSDN example */
639  errno = 0xDEADBEEF;
640  tested.d = 2.387000;
641  expected.l = 0x4033189374BC6A7FLL;
642  result.d = _scalb(tested.d, 3);
643  ok(result.l == expected.l, "_scalb returned: %I64x\n", result.l);
644  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
645 }
646 
647 void test_y0(void)
648 {
649  ieee_double tested;
652 
653  expected.l = 0;
654 
655  errno = 0xDEADBEEF;
656  tested.l = 0xFFFFFFFFFFFFFFFFLL;
657  expected.l = 0xFFFFFFFFFFFFFFFFLL;
658  result.d = _y0(tested.d);
659  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
660  ok(errno == EDOM, "errno: %d\n", errno);
661  errno = 0xDEADBEEF;
662  tested.l = 0xFFF8000000000001LL;
663  expected.l = 0xFFF8000000000001LL;
664  result.d = _y0(tested.d);
665  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
666  ok(errno == EDOM, "errno: %d\n", errno);
667  errno = 0xDEADBEEF;
668  tested.l = 0xFFF8000000000000LL;
669  expected.l = 0xFFF8000000000000LL;
670  result.d = _y0(tested.d);
671  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
672  ok(errno == EDOM, "errno: %d\n", errno);
673  errno = 0xDEADBEEF;
674  tested.l = 0xFFF7FFFFFFFFFFFFLL;
675  expected.l = 0xFFFFFFFFFFFFFFFFLL;
676  result.d = _y0(tested.d);
677  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
678  ok(errno == EDOM, "errno: %d\n", errno);
679  errno = 0xDEADBEEF;
680  tested.l = 0xFFF0000000000001LL;
681  expected.l = 0xFFF8000000000001LL;
682  result.d = _y0(tested.d);
683  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
684  ok(errno == EDOM, "errno: %d\n", errno);
685  errno = 0xDEADBEEF;
686  tested.l = 0xFFF0000000000000LL;
687  expected.l = 0xFFF8000000000000LL;
688  result.d = _y0(tested.d);
689  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
690  ok(errno == EDOM, "errno: %d\n", errno);
691  errno = 0xDEADBEEF;
692  tested.l = 0xFFEFFFFFFFFFFFFFLL;
693  expected.l = 0xFFF8000000000000LL;
694  result.d = _y0(tested.d);
695  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
696  ok(errno == EDOM, "errno: %d\n", errno);
697  errno = 0xDEADBEEF;
698  tested.l = 0x8010000000000000LL;
699  expected.l = 0xFFF8000000000000LL;
700  result.d = _y0(tested.d);
701  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
702  ok(errno == EDOM, "errno: %d\n", errno);
703  errno = 0xDEADBEEF;
704  tested.l = 0x800FFFFFFFFFFFFFLL;
705  expected.l = 0xFFF8000000000000LL;
706  result.d = _y0(tested.d);
707  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
708  ok(errno == EDOM, "errno: %d\n", errno);
709  errno = 0xDEADBEEF;
710  tested.l = 0x8000000000000001LL;
711  expected.l = 0xFFF8000000000000LL;
712  result.d = _y0(tested.d);
713  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
714  ok(errno == EDOM, "errno: %d\n", errno);
715  errno = 0xDEADBEEF;
716  tested.l = 0x8000000000000000LL;
717  expected.l = 0xFFF0000000000000LL;
718  result.d = _y0(tested.d);
719  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
720  ok(errno == ERANGE, "errno: %d\n", errno);
721  errno = 0xDEADBEEF;
722  tested.l = 0x0000000000000000LL;
723  expected.l = 0xFFF0000000000000LL;
724  result.d = _y0(tested.d);
725  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
726  ok(errno == ERANGE, "errno: %d\n", errno);
727  errno = 0xDEADBEEF;
728  tested.l = 0x0000000000000001LL;
729  expected.l = 0xC07D9FFC3469E1B3LL;
730  result.d = _y0(tested.d);
731  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
732  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
733  errno = 0xDEADBEEF;
734  tested.l = 0x000FFFFFFFFFFFFFLL;
735  expected.l = 0xC07C30D8F820740ELL;
736  result.d = _y0(tested.d);
737  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
738  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
739  errno = 0xDEADBEEF;
740  tested.l = 0x0010000000000000LL;
741  expected.l = 0xC07C30D8F820740ELL;
742  result.d = _y0(tested.d);
743  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
744  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
745  errno = 0xDEADBEEF;
746  tested.l = 0x7FEFFFFFFFFFFFFFLL;
747  expected.l = 0x9FD5A36F8428F58BLL;
748  result.d = _y0(tested.d);
749  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
750  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
751  errno = 0xDEADBEEF;
752  tested.l = 0x7FF0000000000000LL;
753  expected.l = 0xFFF8000000000000LL;
754  result.d = _y0(tested.d);
755  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
756  ok(errno == EDOM, "errno: %d\n", errno);
757  errno = 0xDEADBEEF;
758  tested.l = 0x7FF0000000000001LL;
759  expected.l = 0x7FF8000000000001LL;
760  result.d = _y0(tested.d);
761  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
762  ok(errno == EDOM, "errno: %d\n", errno);
763  errno = 0xDEADBEEF;
764  tested.l = 0x7FF7FFFFFFFFFFFFLL;
765  expected.l = 0x7FFFFFFFFFFFFFFFLL;
766  result.d = _y0(tested.d);
767  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
768  ok(errno == EDOM, "errno: %d\n", errno);
769  errno = 0xDEADBEEF;
770  tested.l = 0x7FF8000000000000LL;
771  expected.l = 0x7FF8000000000000LL;
772  result.d = _y0(tested.d);
773  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
774  ok(errno == EDOM, "errno: %d\n", errno);
775  errno = 0xDEADBEEF;
776  tested.l = 0x7FFFFFFFFFFFFFFFLL;
777  expected.l = 0x7FFFFFFFFFFFFFFFLL;
778  result.d = _y0(tested.d);
779  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
780  ok(errno == EDOM, "errno: %d\n", errno);
781 
782  /* MSDN example */
783  errno = 0xDEADBEEF;
784  tested.d = 2.387000;
785  expected.l = 0x3FE05FB1B1E49E66LL;
786  result.d = _y0(tested.d);
787  ok(result.l == expected.l, "_y0 returned: %I64x\n", result.l);
788  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
789 }
790 
791 void test_y1(void)
792 {
793  ieee_double tested;
796 
797  expected.l = 0;
798 
799  errno = 0xDEADBEEF;
800  tested.l = 0xFFFFFFFFFFFFFFFFLL;
801  expected.l = 0xFFFFFFFFFFFFFFFFLL;
802  result.d = _y1(tested.d);
803  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
804  ok(errno == EDOM, "errno: %d\n", errno);
805  errno = 0xDEADBEEF;
806  tested.l = 0xFFF8000000000001LL;
807  expected.l = 0xFFF8000000000001LL;
808  result.d = _y1(tested.d);
809  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
810  ok(errno == EDOM, "errno: %d\n", errno);
811  errno = 0xDEADBEEF;
812  tested.l = 0xFFF8000000000000LL;
813  expected.l = 0xFFF8000000000000LL;
814  result.d = _y1(tested.d);
815  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
816  ok(errno == EDOM, "errno: %d\n", errno);
817  errno = 0xDEADBEEF;
818  tested.l = 0xFFF7FFFFFFFFFFFFLL;
819  expected.l = 0xFFFFFFFFFFFFFFFFLL;
820  result.d = _y1(tested.d);
821  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
822  ok(errno == EDOM, "errno: %d\n", errno);
823  errno = 0xDEADBEEF;
824  tested.l = 0xFFF0000000000001LL;
825  expected.l = 0xFFF8000000000001LL;
826  result.d = _y1(tested.d);
827  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
828  ok(errno == EDOM, "errno: %d\n", errno);
829  errno = 0xDEADBEEF;
830  tested.l = 0xFFF0000000000000LL;
831  expected.l = 0xFFF8000000000000LL;
832  result.d = _y1(tested.d);
833  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
834  ok(errno == EDOM, "errno: %d\n", errno);
835  errno = 0xDEADBEEF;
836  tested.l = 0xFFEFFFFFFFFFFFFFLL;
837  expected.l = 0xFFF8000000000000LL;
838  result.d = _y1(tested.d);
839  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
840  ok(errno == EDOM, "errno: %d\n", errno);
841  errno = 0xDEADBEEF;
842  tested.l = 0x8010000000000000LL;
843  expected.l = 0xFFF8000000000000LL;
844  result.d = _y1(tested.d);
845  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
846  ok(errno == EDOM, "errno: %d\n", errno);
847  errno = 0xDEADBEEF;
848  tested.l = 0x800FFFFFFFFFFFFFLL;
849  expected.l = 0xFFF8000000000000LL;
850  result.d = _y1(tested.d);
851  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
852  ok(errno == EDOM, "errno: %d\n", errno);
853  errno = 0xDEADBEEF;
854  tested.l = 0x8000000000000001LL;
855  expected.l = 0xFFF8000000000000LL;
856  result.d = _y1(tested.d);
857  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
858  ok(errno == EDOM, "errno: %d\n", errno);
859  errno = 0xDEADBEEF;
860  tested.l = 0x8000000000000000LL;
861  expected.l = 0xFFF8000000000000LL;
862  result.d = _y1(tested.d);
863  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
864  ok(errno == ERANGE, "errno: %d\n", errno);
865  errno = 0xDEADBEEF;
866  tested.l = 0x0000000000000000LL;
867  expected.l = 0xFFF8000000000000LL;
868  result.d = _y1(tested.d);
869  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
870  ok(errno == ERANGE, "errno: %d\n", errno);
871  errno = 0xDEADBEEF;
872  tested.l = 0x0000000000000001LL;
873  expected.l = 0xFFF0000000000000LL;
874  result.d = _y1(tested.d);
875  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
876  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
877  errno = 0xDEADBEEF;
878  tested.l = 0x000FFFFFFFFFFFFFLL;
879  expected.l = 0xFFC45F306DC9C884LL;
880  result.d = _y1(tested.d);
881  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
882  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
883  errno = 0xDEADBEEF;
884  tested.l = 0x0010000000000000LL;
885  expected.l = 0xFFC45F306DC9C883LL;
886  result.d = _y1(tested.d);
887  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
888  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
889  errno = 0xDEADBEEF;
890  tested.l = 0x7FEFFFFFFFFFFFFFLL;
891  expected.l = 0x9FD5A36F8428F58BLL;
892  result.d = _y1(tested.d);
893  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
894  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
895  errno = 0xDEADBEEF;
896  tested.l = 0x7FF0000000000000LL;
897  expected.l = 0xFFF8000000000000LL;
898  result.d = _y1(tested.d);
899  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
900  ok(errno == EDOM, "errno: %d\n", errno);
901  errno = 0xDEADBEEF;
902  tested.l = 0x7FF0000000000001LL;
903  expected.l = 0x7FF8000000000001LL;
904  result.d = _y1(tested.d);
905  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
906  ok(errno == EDOM, "errno: %d\n", errno);
907  errno = 0xDEADBEEF;
908  tested.l = 0x7FF7FFFFFFFFFFFFLL;
909  expected.l = 0x7FFFFFFFFFFFFFFFLL;
910  result.d = _y1(tested.d);
911  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
912  ok(errno == EDOM, "errno: %d\n", errno);
913  errno = 0xDEADBEEF;
914  tested.l = 0x7FF8000000000000LL;
915  expected.l = 0x7FF8000000000000LL;
916  result.d = _y1(tested.d);
917  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
918  ok(errno == EDOM, "errno: %d\n", errno);
919  errno = 0xDEADBEEF;
920  tested.l = 0x7FFFFFFFFFFFFFFFLL;
921  expected.l = 0x7FFFFFFFFFFFFFFFLL;
922  result.d = _y1(tested.d);
923  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
924  ok(errno == EDOM, "errno: %d\n", errno);
925 
926  /* MSDN example */
927  errno = 0xDEADBEEF;
928  tested.d = 2.387000;
929  expected.l = 0x3FB828EC13723EE6LL;
930  result.d = _y1(tested.d);
931  ok(result.l == expected.l, "_y1 returned: %I64x\n", result.l);
932  ok(errno == 0xDEADBEEF, "errno: %d\n", errno);
933 }
934 
936 {
937  test_finite();
938  test_fpclass();
939  test_isnan();
940  test_j0();
941  test_j1();
942  test_scalb();
943  test_y0();
944  test_y1();
945 }
#define _FPCLASS_PN
Definition: float.h:76
void test_fpclass(void)
Definition: ieee.c:71
#define TRUE
Definition: types.h:120
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _isnan(_In_ double)
#define LL
Definition: tui.h:85
#define _FPCLASS_NZ
Definition: float.h:73
#define _FPCLASS_PINF
Definition: float.h:77
#define _FPCLASS_NN
Definition: float.h:71
void test_isnan(void)
Definition: ieee.c:164
void test_j0(void)
Definition: ieee.c:215
int errno
_Check_return_ _CRTIMP double __cdecl _j0(_In_ double x)
#define _FPCLASS_PZ
Definition: float.h:74
#define _FPCLASS_PD
Definition: float.h:75
void test_scalb(void)
Definition: ieee.c:503
long long l
Definition: ieee.c:17
#define EDOM
Definition: errno.h:39
_Check_return_ __MINGW_NOTHROW _CRTIMP double __cdecl _scalb(_In_ double, _In_ long)
_Check_return_ _CRTIMP double __cdecl _y1(_In_ double x)
void test_y1(void)
Definition: ieee.c:791
#define d
Definition: ke_i.h:81
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _finite(_In_ double)
double d
Definition: ieee.c:16
#define _FPCLASS_ND
Definition: float.h:72
#define ERANGE
Definition: acclib.h:92
#define _FPCLASS_NINF
Definition: float.h:70
void test_j1(void)
Definition: ieee.c:359
#define ok(value,...)
Definition: atltest.h:57
#define _FPCLASS_QNAN
Definition: float.h:69
_Check_return_ _CRTIMP double __cdecl _j1(_In_ double x)
_Check_return_ __MINGW_NOTHROW _CRTIMP int __cdecl _fpclass(_In_ double)
GLuint64EXT * result
Definition: glext.h:11304
START_TEST(ieee)
Definition: ieee.c:935
void test_y0(void)
Definition: ieee.c:647
BOOL expected
Definition: store.c:2063
_Check_return_ _CRTIMP double __cdecl _y0(_In_ double x)
void test_finite(void)
Definition: ieee.c:20