
20 Sep
2010
20 Sep
'10
11:18 p.m.
On Mon, Sep 20, 2010 at 03:22, Daniel Fischer
unsafeCoerce is not supposed to work for casts between Integral and Floating types. If you try to unsafeCoerce# between unboxed types, say Double# and Word64#, you're likely to get a compile failure (ghc panic). If you unsafeCoerce between the boxed types, it will probably work, but there are no guarantees.
There's a feature request for unboxed coercion (i.e. reinterpretation of the bit-pattern):
Interesting -- in that bug report, Simon Mar says that converting the value using pointers will work correctly. I've changed d-b-ieee754 over to use this method (v 0.4.2); the tests are still passing, so I'll call it success.