Another simpler example, not involving unions:
-----8<-----
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(int argc, char** argv) {
double d[2];
d[0] = NAN;
d[1] = -d[0];
printf("%F\n", d[1]);
}
-----8<-----
Another simpler example, not involving unions:
-----8<-----
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(int argc, char** argv) {
double d[2];
d[0] = NAN;
d[1] = -d[0];
printf("%F\n", d[1]);
}
-----8<-----
Gives NAN on '030 & '882, '040, '060, with gcc 7.4.0 & gcc 10.3.0.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 113 |
Nodes: | 8 (1 / 7) |
Uptime: | 67:29:38 |
Calls: | 2,472 |
Calls today: | 1 |
Files: | 8,642 |
Messages: | 1,899,422 |