1 /* N1150 4: Characteristics of decimal floating types (not explicit)
2    C99 5.2.4.2.2: Characteristics of floating types.
3    A few simple checks on arithmetic operations.  Based on nan-1.c with
4    the consideration of negative zero.  */
5 
6 #include "dfp-dbg.h"
7 
main()8 int main()
9 {
10   _Decimal32 d32;
11   _Decimal64 d64;
12   _Decimal128 d128;
13 
14   /* Verify that division by negative zero produces a negative infinity
15      result.  */
16   d32 = 123.45f;
17   if (d32/-0.0df != -__builtin_infd32())
18     FAILURE
19   if (123.45df/-0.0df != -__builtin_infd32())
20     FAILURE
21 
22   d64 = 123.45f;
23   if (d64/-0.0dd != -__builtin_infd64())
24     FAILURE
25   if (123.45dd/-0.0dd !=  -__builtin_infd64())
26     FAILURE
27 
28   d128 = 123.45f;
29   if (d128/-0.0dl != -__builtin_infd64())
30     FAILURE
31   if (123.45dl/-0.0dl != -__builtin_infd128())
32     FAILURE
33 
34   d32 = 0.0df;
35   if (!__builtin_isnand32(-(d32/-0.0df)))
36     FAILURE
37   if (!__builtin_isnand32(-(0.0df/-0.0df)))
38     FAILURE
39 
40   d64 = 0.0dd;
41   if (!__builtin_isnand64(-(d64/-0.0dd)))
42     FAILURE
43   if (!__builtin_isnand64(-(0.0dd/-0.0dd)))
44     FAILURE
45 
46   d128 = 0.0dl;
47   if (!__builtin_isnand128(-(d128/-0.0dl)))
48     FAILURE
49   if (!__builtin_isnand128(-(0.0dl/-0.0dl)))
50     FAILURE
51 
52   FINISH
53 }
54