[Haskell-cafe] floating point operations and representation
Henning Thielemann
lemming at henning-thielemann.de
Thu Mar 13 08:51:45 EDT 2008
On Thu, 13 Mar 2008, Lennart Augustsson wrote:
> Wow, you have a tough mission if you want to replicate the bit level answers
> for double (btw, hi Jacob).
> Libraries differ for transcendental function, and even worse, CPUs differ.
> You may get different answers on an Intel and and AMD.
> That said, I think your best bet is to import log2 and log10 from C and use
> those.
>
> Haskell sadly lacks an efficient way to go from a Double to its bit pattern.
> :(
You can do nasty casting using STArray:
http://slavepianos.org/rd/sw/sw-78/Sound/OpenSoundControl/Cast.hs
More information about the Haskell-Cafe
mailing list