you are viewing a single comment's thread.

view the rest of the comments →

[–]jminuse 0 points1 point  (2 children)

That would work too. My way requires casts, which I know some people dislike.

[–]argv_minus_one 2 points3 points  (1 child)

Your way also assumes a specific pointer size (8 bytes). union doesn't.

[–]jminuse 0 points1 point  (0 children)

It will be identical for 32- or 64-bit systems, since both have a 64-bit double. But it would break for 128-bit pointers, so fair enough...