
On Tue, Dec 16, 2008 at 10:17 PM, David Abrahams <dave@boostpro.com> wrote:
on Tue Dec 16 2008, "Giovanni Piero Deretta" <gpderetta-AT-gmail.com> wrote:
On Tue, Dec 16, 2008 at 3:03 PM, Pyry Jahkola <pyry.jahkola@gmail.com> wrote:
Gevorg Voskanyan wrote:
I suggest modifying CastFloatIter() function to use memcpy for accessing floats as integers, as shown below:
Hmm, I don't think it's any better than reinterpret casting.
Yes it is. It has the nice property of not leading to UB.
If so, that surprises me. Is it really guaranteed that all valid floating-point bit patterns are also valid integer bit patterns?
Well, in general I do not think so. I should have said that the result is implementation defined. But it is defined on most common architectures and their compilers. -- gpd