Message158752
| Author |
kristjan.jonsson |
| Recipients |
eric.snow, jcea, kristjan.jonsson, mark.dickinson, michael.foord, pitrou, rhettinger, serhiy.storchaka |
| Date |
2012年04月19日.21:06:28 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334869588.83.0.175336699938.issue14381@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
return *(PY_LONG_LONG*)&fval == 0;
There is no aliasing, because there are no pointer variables in existence.
If we did this:
double *pfval = &fval;
PY_LONG_LONG *pl = (PY_LONG_LONG*)pfval
return *pfval == 0
Then we would have aliasing. Because "pfval" in this example doesn't exist but is merely a temporary, there is no aliasing.
As for IEEE compatibility, I don't think we could have our own floating point formatting library if we didn't make that assumption, but I might be wrong about that. On the other hand, I don't think there is a supported python architecture that defines positive zero as anything else than bitwise zero. And should such a platform be found, it is easy enough to disable this code for it. |
|