This also checks that -(-0.0) is +0.0.
Unified · Split
| @@ -1721,6 +1721,12 @@ void prefix ## signed_zeros(void) \ · 1720 unmodified lines | |||
| 1721 | 1.0 / x != 1.0 / p);\ | 1721 | 1.0 / x != 1.0 / p);\ |
| 1722 | else\ | 1722 | else\ |
| 1723 | printf ("x != +y; this is wrong!\n");\ | 1723 | printf ("x != +y; this is wrong!\n");\ |
| 1724 | p = -y;\ | ||
| 1725 | if (x == p)\ | ||
| 1726 | printf ("Test 1.0 / x != 1.0 / -y returns %d (should be 0).\n",\ | ||
| 1727 | 1.0 / x != 1.0 / p);\ | ||
| 1728 | else\ | ||
| 1729 | printf ("x != -y; this is wrong!\n");\ | ||
| 1724 | }\ | 1730 | }\ |
| 1725 | void prefix ## test(void)\ | 1731 | void prefix ## test(void)\ |
| 1726 | {\ | 1732 | {\ |