from c99 appendix F p 445
F.4 Floating to integer conversion
[#1] If the floating value is infinite or NaN or if the
integral part of the floating value exceeds the range of the
integer type, then the invalid exception is raised and the
resulting value is unspecified.
this indicates that the bug is in the test
here is a modified test with sol11.sun4 results
could someone run it on sol11.i386
---
#define _ISOC99_SOURCE 1
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
int main(int argc, char** argv)
{
long double f;
long long s;
unsigned long long u;
f = INFINITY;
s = f;
u = f;
printf("%4Lf %20lld 0x%016llx %20llu 0x%016llx\n", f, s, s, u, u);
f = -f;
s = f;
u = f;
printf("%4Lf %20lld 0x%016llx %20llu 0x%016llx\n", f, s, s, u, u);
return 0;
}
---
sol11.sun4 /opt/SUNWspro/bin/cc results
Inf 9223372036854775807 0x7fffffffffffffff 18446744073709551615
0xffffffffffffffff
-Inf -9223372036854775808 0x8000000000000000 9223372036854775808
0x8000000000000000
linux.i386 gcc versions { 3.4.6 4.1.2 } results
inf -9223372036854775808 0x8000000000000000 0
0x0000000000000000
-inf -9223372036854775808 0x8000000000000000 9223372036854775808
0x8000000000000000
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers